Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
CalculateOnBarClose?
Collapse
X
-
On any tick where the condition happens.Originally posted by kinkeadfx View PostI understand when using automated strategies with CalculateOnBarClose set to True that your orders are placed at the close of the bar, but when set to False where do the orders get filled?
EntriesPerDirection can limit that to only 1 order, so you don't send thousands of orders.
-
kinkeadfx, what orders types are you working with here? You are correct in understanding that with CalculateOnBarClose = true the OnBarUpdate() is only called when the bars are closed, that happens in NT when the open tick of the next bar was seen and this would be the first point you could trade at - so the open and closing tick are essentially the same.
Comment
-
CalculateOnBarClose is not really relevant in any context where there is no (quasi or true) live streaming data. The program can only process data that it has available, and the only available data during a Backtest is the OHLC data, so updates can only be run on the bar once. In effect with Backtesting, CalculateOnBarClose is always processed as if it were true.Originally posted by kinkeadfx View PostWhen backtesting on Ninjatrader how does it calculate its results? I usually see where trades were placed at the open of the bar, can this be a result of CalculateOnBarClose set to False?
Comment
-
Changing it not specifically needed, however you generally want to ensure you don't set any COBC hardcoded in any of your strategy called scripts.Originally posted by kinkeadfx View PostOk so when using CalculateOnBarClose set to False on automated strategies, do the indicators used in the strategy need to be set to False as well so that everything works right?
Comment
-
There seems to be a consensus that if you do not use a CalculateOnBarClose directive in the indicator, when it, the indicator is called from a strategy, the indicator adopts the COBC setting from the strategy.Originally posted by kinkeadfx View PostOk so when using CalculateOnBarClose set to False on automated strategies, do the indicators used in the strategy need to be set to False as well so that everything works right?
However, even if you do use a COBC directive in the indicator, you can always set COBC false for the indicator every time that you call the indicator from the strategy. After all, it is just a property of the indicator object. In that case, it is best to use a named instance. Heck, it is always best to use a named instance.
Comment
-
Are you talking real time, or in backtest?Originally posted by kinkeadfx View PostHow could i get my entry order to open on the first tick of the next bar after the strategy gives a signal?
Real time, that is the behavior if CalculateOnBarClose is true. In backtest, depending on how your signal is validated, it might work that way, or you might need to use a multi-timeframe script that uses a finer granularity barSeries, (1-tick or 1-range), to place orders that are triggered on the higher timeframe barSeries.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
69 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
42 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
24 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
27 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
54 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment