Reply

Why does trade not open at open of the bar?

2 replies

Schutten

Customer, bbp_participant, community, 52 replies.

Visit profile

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;

 

 

0

Mark Fric

Administrator, sq-ultimate, 2 replies.

Visit profile

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

0

Matusiak Adrian

Customer, bbp_participant, community, 300 replies.

Visit profile

9 years ago #129102

Hello,

 

Can You provide strategy file? Then we can see source.

btn_viewmy_160x33.png

0

Viewing 2 replies - 1 through 2 (of 2 total)