1 bar/1 trade

 

Hi all, how set my ea when i need enter to position only once per bar. 1bar/1 trade (sell or buy)

If will be take SL or TP next enter to trade in same bar must be prohibited. Thank you.

 

Easiest way would be to set global datetime variable that is set to the date after which you allow the next trade to execute.

You'd need to check the current bar, current open orders and orders history to check when the last trade was exectued in order to correctly set the above variable.

 
forexCoder:

Easiest way would be to set global datetime variable that is set to the date after which you allow the next trade to execute.

You'd need to check the current bar, current open orders and orders history to check when the last trade was exectued in order to correctly set the above variable.


Can i use instuction from this topic: https://www.mql5.com/en/forum/132473 ? (my EA trade on D1 timeframe too)
 
What WHRoeder posted in last post will work for you with a slight modification.