Why does trade not open at open of the bar?
2 replies
Schutten
9 years ago #113400
Hi,
I have a very simple code which should open a trade when conditions are met ONLY at the open of a bar and close at the same bar.
It closes indeed at the close, however it opens not at the open but at a price I cannot trace. Please help!
Regards,
Dennis
If (IsBarOpen is True) && (((Close[2] > Close [1]) and ( Market Position() is Flat) And (IsBarOpen is True))))
THEN
Buy 0.1 Lots at market
Magicnumber= 1000;
Close position after 1 bars
End If;
Mark Fric
9 years ago #129063
it should open the trade at bar open. I tested it in MT4 and it works, I cannot imagine what could be wrong in your case.
Are you trading it on MT4? When are the trades opened, does it take long from open since they are opened?
Mark
StrategyQuant architect
Matusiak Adrian
9 years ago #129102
Viewing 2 replies - 1 through 2 (of 2 total)