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
"Buy next bar Limit" question
- Kate MultiCharts
- Posts: 667
- Joined: Oct 21 2020
- Has thanked: 13 times
- Been thanked: 174 times
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,
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;