#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
namespace NinjaTrader.Strategy
{
[Description("Enter the description of your strategy here")]
public class AAATest : Strategy
{
#region Variables
private DataSeries plot, plot1;
#endregion
protected override void Initialize()
{
CalculateOnBarClose = true;
plot = new DataSeries(this);
plot1 = new DataSeries(this);
}
protected override void OnBarUpdate()
{
plot1.Set(5);
plot.Set(SMA(plot1, 5)[0]);
Print("** " + plot1[0] + " " + plot1[1] + " " + plot1[2] + " " + plot1[3] + " " + plot1[4] +" ** = Last 5 values of plot1");
Print(" ");
Print("-- " + plot[0] + " -- " + SMA(plot1, 5)[0] + " ---- == SMA(plot1, 5)[0]");
Print(" ");
Print(" ");
Print(" ");
Print(" ");
}
}
}
** 5 5 5 5 5 ** = Last 5 values of plot1
-- -388 ---388 ---- == SMA(plot1, 5)[0]
** 5 5 5 5 5 ** = Last 5 values of plot1
-- -389 ---389 ---- == SMA(plot1, 5)[0]
** 5 5 5 5 5 ** = Last 5 values of plot1
-- -390 ---390 ---- == SMA(plot1, 5)[0]
Something is not right
Thanks for looking

Comment