Pablo Rego:
Global variables in MT5 backtest are "emulated", that's not the same as Global variables used on a live chart.
I am trying to save the last backtime time in a global variable from MT5, but for some reason the global variable is not created. Still when I create the variable before backtest (outside from EA), the value is not updated. What should I have missed?
I used
void OnDeinit(const int reason){
GlobalVariableSet("Last backtesting time ",TimeToString(TimeLocal()));
}
GlobalVariableSet("Last backtesting time ",TimeToString(TimeLocal()));
}
Just a note, the same call from MT4 works perfectly.
Alain Verleyen:
Global variables in MT5 backtest are "emulated", that's not the same as Global variables used on a live chart.
Hmm. Ok so. Thanks.
Global variables in MT5 backtest are "emulated", that's not the same as Global variables used on a live chart.
Alain Verleyen:
Global variables in MT5 backtest are "emulated", that's not the same as Global variables used on a live chart.
Also you should read the documentation. What is the datatype for the second argument of Global Variables of the Terminal / GlobalVariableSet - Reference on algorithmic/automated trading language for MetaTrader 5 and what are you passing?
Global variables in MT5 backtest are "emulated", that's not the same as Global variables used on a live chart.
void OnDeinit(const int reason){
GlobalVariableSet("Last backtesting time ",TimeToString(TimeLocal()));
}
GlobalVariableSet("Last backtesting time ",TimeToString(TimeLocal()));
}

Documentation on MQL5: Global Variables of the Terminal / GlobalVariableSet
- www.mql5.com
Global Variables of the Terminal / GlobalVariableSet - Reference on algorithmic/automated trading language for MetaTrader 5

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I am trying to save the last backtime time in a global variable from MT5, but for some reason the global variable is not created. Still when I create the variable before backtest (outside from EA), the value is not updated. What should I have missed?
I used
GlobalVariableSet("Last backtesting time ",TimeToString(TimeLocal()));
}
Just a note, the same call from MT4 works perfectly.