Forum

Invalid volume for HSBC but not RBS

Hi again to this wonderful community! I'm using this very simple position sizing code to determine how many lots to buy - it began life as a Forex lot sizer, and I'm now trying to use it for stock CFDs, however it seems to only work for some stocks, and generates volume errors when used for others

Why is this simple bit of code not working?

I'm doing a MACD crossover EA to test my MQL5 skills, however I cannot understand why this simple comparison isn't working at times, but is working at others when I run the stategy tester. At 2019.09.02 01:03:00 on the strategy tester journal (red box on screenshot), the conditions (MACD0 > MACD1)