Buy this bar at open

Questions about MultiCharts and user contributed studies.
no erocla
Posts: 134
Joined: 31 May 2013
Has thanked: 60 times
Been thanked: 7 times

Buy this bar at open

Postby no erocla » 13 Sep 2019

On daily data, i would like to chech Open Price to decide if i will trade or not on Open Price.

The code should be simply this:

if o > average(o,20) then buy 100 contracts this bar at open.

But, "this bar" sentence is allowed only for close price....

It's impossibile ? Any idea ?

wilkinsw
Posts: 662
Joined: 21 Apr 2013
Has thanked: 154 times
Been thanked: 104 times

Re: Buy this bar at open

Postby wilkinsw » 17 Sep 2019

Look up "open next bar".

Replace your "O" with "open next bar".

Send orders "next bar". "Next bar" equals the same bar as the open tick you're referencing using "open next bar"

no erocla
Posts: 134
Joined: 31 May 2013
Has thanked: 60 times
Been thanked: 7 times

Re: Buy this bar at open

Postby no erocla » 17 Sep 2019

Thank you for the solution, it is working.
Unfortunately, does not work on multiple data stream.... any idea ?

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Buy this bar at open

Postby TJ » 18 Sep 2019

The strategy calculation is done at the end of a bar (EOB).
How soon do you want to trade AFTER the opening of the market?

Bear in mind, your vision might be trading on a daily bar, but in practice, you are actually trading intraday.
Therefore your analysis must include an intraday chart.


Return to “MultiCharts”