I understand that no calculation is done until after the bar has been closed but it seems that since I am entering a trade based on that bar it would draw the entry/exit markers on that bar and not the next one.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
entry and exit plots on charts using OnBarClose
Collapse
X
-
entry and exit plots on charts using OnBarClose
I am using the Calculate.OnBarClose to do my calculations for a strategy, my question is, when entering a long or short, the plot markers on the chart show the trade as taking place on the next bar, not the bar that the calculation is actually done on.
I understand that no calculation is done until after the bar has been closed but it seems that since I am entering a trade based on that bar it would draw the entry/exit markers on that bar and not the next one.Tags: None
-
Hello andrewjoseph939,
Thanks for your question. I have moved this thread to the Strategy Development forum as you are referring to NinjaScript strategies.
With Calculate.OnBarClose, the strategy logic is calculated after the bar has closed. The bar is already closed and then the order is submitted, so the order will be filled with the price action that comes after that bar closed. The execution markers will show on the bar where the order was executed.
If you would like to learn more about how orders are filled in a backtest, please see below. (Please note that there is no intrabar movement with a backtest, so fill prices are estimated using "virtual bars" to mimic how the market may have moved.
https://ninjatrader.com/support/help...ical_fill_.htm
Realtime orders will be filled with actual market data after the order is submitted.
Please let us know if you have any additional questions.
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
41 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
20 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
28 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
45 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
37 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment