Quote:
|
Originally Posted by Willis11of12
static bool ITradedOnThisBar;
Just before opening any trades:
if(ITradedOnThisBar != Bars)
{
Right after opening a sell or buy order:
ITradedOnThisBar = Bars;
|
Willis11of12's solution is very good, i also use it to prevent multiple orders in the same bar, but it dosen't prevent wrong Order Closes, my solution for that problem is to get a confirmation from MA
when we get a buy signal, the fastEMA crossed the SLowEMA from down, so the close time would be whenever FastEMA cross SlowEMA from up
for simpler coding i write a few code for checking EMA direction, when the EA wants to close the order, EMA direction must be Oposite Open condition