Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Execute At Open
Collapse
X
-
Hello siroki,
Thank you for your response.
There a few items your inquiry could relate to. May we ask for further clarification?
Please answer the following questions.
Are you looking for the calculation of your logic to be performed only the Open as opposed to the Close?
Are you looking to have the executions only occur on the Open of the bar and never after or on the Close?
Are you looking for an intra-bar calculation much like running in real-time or Tick Replay?
I look forward to your response.
Comment
-
Ideally I would like to be flexible in binding the entry/exit to open/close.. So for example: I would like to have a strategy where the exit is based on the Open of a candle and the Exit is based on the Close of a candle.
But to have at least have an Entry based on the Open of a candle would be great. The whole problem is when testing stock strategies, the close of a candle does not mean you can enter the stock at the closing price. Especially in daily strategies where you can have gaps.
Comment
-
But how does that work? Because once a candle close, you know the Close and the Open of that particular candle. If you EnterLongLimit(Open[0]), aren't you trying to enter the instrument at the Open price of the candle that just closed?
Furthermore, I want to measure certain indicators at moment the candle opens. And if the criteria are met, then enter immediately at the open.
Comment
-
Hello,
You are correct, in a Backtest that would be the last closed candle, the code below would do what you are asking, but only in realtime and with CalculateOnBarClose set to false.
For BackTesting, you would essentially need to add a 1 tick series from the strategy and then on the 1st Tick after the Primary series bar closes, that would be the Open of the bar in which you could execute your logic.Originally posted by NinjaTrader_PatrickH View PostSo something like the following?
Code:if(Close[0] > Open[0]) EnterLongLimit(Open[0]);
NinjaTrader has no way of changing the Calculation to Open instead of Close of the bar so using a Tick series would be the only way to do this in a backtest.
I look forward to being of further assistance.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
669 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
378 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
111 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
575 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
580 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment