Page 1 of 1

"Buy next bar Limit" question

Posted: Aug 31 2021
by joebone
I have a rolling calculation for my Limit price in my order:

Buy next bar at "Limit_calc" Limit;

Is this limit price calculated on the open price of the next bar or is it calculated on the close of the previous bar?

Didnt see the answer here : https://www.multicharts.com/trading-sof ... itle=Limit

Re: "Buy next bar Limit" question

Posted: Sep 01 2021
by Kate MultiCharts
Hello joebone,

You can specify or calculate the price order placement price yourself, it does not depend on the bar.

You’ll receive the bar’s Open or Close only when the bar is closed as the script is calculated when the Barstatus = 2. So, when the bar is closed and a new one is open, you’ll get the Open of the closed bar, not the newly opened one.

So, you’ll need to enable the IOG and calculate the bar’s Open when the Barstatus = 0.
For example,

Code: Select all

[AllowSendOrdersAlways = true]; var: Price(0); if barstatus = 0 then begin Price = Open; end; buy next bar at Price + 1 Limit;