... PlotInput is a simple Indicator (overlay on chart), which only difference with the default generated script is to use Input[0] instead of Close[0].
(well, not really, it also set the Pen witdth: Plots[0].Pen.Width = 5; )
The following strategy just use a DataSeries object to hold the Close values, and uses the PlotInput indicator on that DataSeries object.
By default, Ninja uses MaximumBarsLookBack = 256 and the results are beyond my understanding (see attached).
#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Strategy;
#endregion
// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
/// <summary>
/// Enter the description of your strategy here
/// </summary>
[Description("Enter the description of your strategy here")]
public class MyCustomStrategy : Strategy
{
#region Variables
// Wizard generated variables
private int myInput0 = 1; // Default setting for MyInput0
// User defined variables (add any user defined variables below)
private DataSeries aDataSeries;
#endregion
/// <summary>
/// This method is used to configure the strategy and is called once before any strategy method is called.
/// </summary>
protected override void Initialize()
{
aDataSeries = new DataSeries(this);
Add( PlotInput( aDataSeries ) );
CalculateOnBarClose = true;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
aDataSeries.Set( Close[0] );
PlotInput( aDataSeries );
}
#region Properties
[Description("")]
[GridCategory("Parameters")]
public int MyInput0
{
get { return myInput0; }
set { myInput0 = Math.Max(1, value); }
}
#endregion
}
}

Comment