BacktestLineBreak Bars

Summary

SiBacktestLineBreak is the first back testable Line Break bar for NinjaTrader. This unique charting style was invented in Japan, and introduced by NinjaTrader in version 7. The Line Break chart is one of the most effective ways to reduce chart noise.

In this image »

  • #1 Points out the missing wick data that is required for accurate back-testing. Price made a big move up that the SiBacktestLineBreak chart shows, but the traditional Line Break is missing.
  • #2 Shows how much the Open price has been modified. Using the true Open price is critical for accurate back-testing.

The traditional Three Line Break chart (shown below) generates a clean looking chart that is quite similar to a Renko chart. It generates an unpolluted visual aid, which is easy on the eyes and simple to follow. Unfortunately, the traditional Line Break chart gives incorrect back-test results, due to the modification of Open prices and the removal of bar wicks.


On the other hand, the SiBacktestLineBreak provides accurate back-testing results by showing the correct Open prices and restoring the wicks. Adding all of the necessary price data is the reason the SiBacktestLineBreak has such a unique look. For more, see the detailed explanation below the chart.

Furthermore, the SiBacktestLineBreak has the ability to correct volume issues with the NinjaTrader LineBreak. For example, the volume for NinjaTrader LineBreak bars are incorrect when the Base period type is set to Tick, Second, Day, Week, or Month. With the SiBacktestLineBreak, this is no longer a concern. Click to see an example.

Resources




Data Series » Properties

Line Breaks:  The Line Breaks value sets the number of bar bar (lines) that the Close must "break" in order to draw a line in the opposite direction.  e.g.  A value of 3, the common Line Break value, means a reversal down bar occurs only if the close of the current bar is less than the low of the specified number of prior  traditional/non-backtestable Line Break lines(bars).  The term lines means bars.  This bar type could be called Bar Breaks.

Base period type:  This determines the base bar type used to build the Linebreak bars (i.e., Tick, Volume, Minute, Day).

Base period value:  .This sets the Base period's interval.  e.g.  If the Base period is Tick, and this is 150, a 150 Tick bar is used.


Using the BacktestLineBreak in NinjaScript


Please note, this information is provided for professional programmers only.  SharkIndicators does not provide coding support.  For further help or assistance with issues, please contact a NinjaScript  programmer or NinjaTrader support.  Thank you.

NinjaTrader 8

This example illustrates how to add the BTLineBreak bars to your NinjaScript.  It will add a BTLineBreak B:5 T:2 R:10 Backtest Mode:On  bar.

  • Value is the 'Line Breaks' parameter.
  • BaseBarsPeriodType is the 'Base period type' parameter (e.g. Minte, Tick, Volume).
  • BaseBarsPeriodValue is the 'Base period value' parameter (Period of the underlying chart type).
// NinjaTrader 8
else if (State == State.Configure)
{
	AddDataSeries(new BarsPeriod() { BarsPeriodType = (BarsPeriodType)20123, Value = 3, BaseBarsPeriodType = BarsPeriodType.Minute, BaseBarsPeriodValue = 1 });
}

Example File

This example indicator can be found in the SharkIndicators folder > Examples > SiBTLineBreakSMAExample.  It demonstrates how to add the BTLineBreak as a secondary data series to your NinjaScript.
Download the import file below and import it into NinjaTrader using Tools » Import » NinjaScript Add-On.
Download import file for NT 8 (.zip)