"Buy next bar Limit" question

Questions about MultiCharts and user contributed studies.
User avatar
joebone
Posts: 175
Joined: 05 Sep 2018
Has thanked: 53 times
Been thanked: 4 times

"Buy next bar Limit" question

Postby joebone » 31 Aug 2021

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

User avatar
Kate MultiCharts
Posts: 593
Joined: 21 Oct 2020
Has thanked: 9 times
Been thanked: 148 times

Re: "Buy next bar Limit" question

Postby Kate MultiCharts » 01 Sep 2021

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;


Return to “MultiCharts”