Gooly is correct, as the "lastTick.last" value is only valid in a MT5/MQL5 environment. However, use the lowercase version of "lastTick.bid" and/or "lastTick.ask" (as the names are case sensitive).
Also remember to check the return results of the SymbolInfoTick() and to address any 4066 and 4073 errors with a respective delay if using multi-symbol (due to the symbol in question not being yet loaded during the first call to the function).
PS! Remember that in the Strategy Tester you cannot use multi-symbol and the function will cause a 4059 error for any symbol other than the one being tested.
To add comments, please log in or register