Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Issues with strategies on linebreak charts
Collapse
X
-
Issues with strategies on linebreak charts
I would like a clear answer on this as I haven't gotten one yet. I've been running strategies on LineBreak Charts and getting vastly different results between live and backtesting over the same period - I am using all the same conditions and data. There is no consistency between the trades it takes - it may take many more or fewer trades live than in backtest and at completely different times. Why is this?Tags: None
-
Hello samish18,
Thank you for your post.
LineBreaks bars are similar to Renko bars in that they change the open price after the bar is forming. These types of bars aren't great for backtesting, and won't work with Tick Replay.
You may consider instead testing using the Playback connection with Market Replay data.
-
Hello samish18,
The bar itself is going to have different values because of how the bar forms. The Open price can change after it has already formed - it doesn't matter what Calculate logic OnBarUpdate() is running.
1-tick intrabar granularity can ensure your orders fill at an accurate price, but this won't stop the bar values from being different.
Please let me know if you have any further questions.
Comment
-
I am aware of the price issue when using lineBreak bars, that is not my concern as for 15 minute linebreak bars, I execute orders on a 1 minute additional data series and get accurate price fills. My concern has to do with the great discrepancy between trades live and in backtest - no correlation between the two
Comment
-
Hello samish18,
As mentioned, LineBreak bars aren't ideal for backtesting precisely because of this price issue. This is difficult to simulate historically, which is what backtesting is run on - historical data. This is why there is a discrepancy.
It doesn't matter if you are using OnBarClose, or executing orders on a more granular data series. The more granular series isn't going to stop the price from changing.
Comment
-
Hello samish18,
Please refer to my previous post:
You're using LineBreak bars to backtest - the LineBreak bars values change. This is difficult to simulate historically. The nature of the bars is that the values can change after they have already formed.The bar itself is going to have different values because of how the bar forms.
As you've mentioned - you are seeing a discrepancy in live vs. backtest when using LineBreak bars. There is no way to stop or change the price from being different.
All bars that use isRemoveLastBarSupported aren't ideal for backtesting (Renko, HeikenAshi, LineBreak, etc). If you take a look at the code for LineBreak, you will see that it uses IsRemoveLastBarSupported. RemoveLastBar allows the BarsType to remove the last data point and amend all the values on an already closed bar.
All bar types that are IsRemoveLastBarSupported cannot be used with TickReplay and generally cause inaccurate results when backtesting in historical data.
Unfortunately, we don't have a solution or workaround to get LineBreak bars to have high accuracy in backtest. Otherwise, I would have already gladly provided it to you.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
38 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
124 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
64 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
41 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
46 views
0 likes
|
Last Post
|

Comment