Download MetaTrader 5
To add comments, please log in or register
Publish programs in Code Base. Improve your rating!
Abhishek Mishra
49
Abhishek Mishra 2015.09.09 06:28 

Hello 

 

I need help to calculate Low of previous bar for multi symbol through one EA.
I was using ilow() function.

I did not get correct update low of previous bar. 

Keith Watford
Moderator
7990
Keith Watford 2015.09.09 06:31  
What code did you use, what was the result, what should it have been?
Abhishek Mishra
49
Abhishek Mishra 2015.09.09 07:08  
GumRai:
What code did you use, what was the result, what should it have been?
EA runs at the the first tick of new bar to calculate low value of previous bar for multiple symbol.
Sometimes, issue arise that at current bar EA reads Low[2] instead of Low[1]  of some symbol.
Keith Watford
Moderator
7990
Keith Watford 2015.09.09 10:25  
abhishek_hpcs:
EA runs at the the first tick of new bar to calculate low value of previous bar for multiple symbol.
Sometimes, issue arise that at current bar EA reads Low[2] instead of Low[1]  of some symbol.

When the first tick of a new bar comes on the chart that the EA is attached, the first tick of a new bar for another symbol may not have arrived yet. So your code will return Low[1] which would be the same as low[2] 1 tick later.

You could check the bar open time to make sure that you are getting the correct value. 

/
To add comments, please log in or register