Download MetaTrader 5

EA Testing, Seconds Modelling

To add comments, please log in or register
fxscout
13
fxscout  
I am new to mql4, and I would like to see the algorithm of how the seconds are modeled in MQL4 back testing, Thanks.
Keith Watford
Moderator
10614
Keith Watford  
fxscout:
I am new to mql4, and I would like to see the algorithm of how the seconds are modeled in MQL4 back testing, Thanks.
Seconds are not modeled as such, ticks are.

I can only guess that the seconds are calculated by dividing the time-frame seconds by the tick volume for use with TimeCurrent()
fxscout
13
fxscout  
I do not know if I understand it wrong, but in this link talks about modeling seconds https://docs.mql4.com/dateandtime/seconds  Note At the testing, the last known server time is modelled.
Seconds - Date and Time - MQL4 Reference
Seconds - Date and Time - MQL4 Reference
  • docs.mql4.com
Seconds - Date and Time - MQL4 Reference
Keith Watford
Moderator
10614
Keith Watford  
fxscout:
Note At the testing, the last known server time is modelled.
TimeCurrent() is modeled in the tester and has been for a long time, not sure about Seconds()
fxscout
13
fxscout  
How to get the value of Close  in MQL4        double CL = Close[0]   What is the equivalent in MQL5
Fernando Carreiro
2958
Fernando Carreiro  
fxscout: How to get the value of Close in MQL4  "double CL = Close[0]" What is the equivalent in MQL5

Please read the article, Migrating from MQL4 to MQL5, specifically section 3. Predefined Variables for "Close[]", and I quote:

3. Predefined Variables

MQL4
 MQL5Description
double Close[]
double Close[];
int count;   // number of elements to copy
ArraySetAsSeries(Close,true);
CopyClose(_Symbol,_Period,0,count,Close);
Close
Series array that contains close prices for each bar of the current chart.
CopyClose, ArraySetAsSeries
Close - Predefined Variables - MQL4 Reference
Close - Predefined Variables - MQL4 Reference
  • docs.mql4.com
Close - Predefined Variables - MQL4 Reference
To add comments, please log in or register