I am trying to figure out to fix this this but I am at loss. I am not sure what does that error message "The best overloaded method match for 'NinjaTrader.Indicator.IndicatorBase.Add(NinjaTrad er.Gui.Chart.Line)' has some invalid arguments" mean. I tried in Indicator edit and got the same error.
Can you point out where I did wrong? Will appreciate your help!
Thanks,
-traderjh
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
{
/// <summary>
/// Triple T3
/// </summary>
[Description("TripleT3")]
public class TripleT3 : Strategy
{
#region Variables
private int period1 = 2;
private int tcount1 = 2;
private double vfactor1 = 0.6;
private int period2 = 4;
private int tcount2 = 4;
private double vfactor2 = 0.7;
private int period3 = 5;
private int tcount3 = 5;
private double vfactor3 = 0.8;
private DataSeries fastPrice;
private DataSeries medPrice;
private DataSeries slowPrice;
private int digitSize;
private double pipSize;
#endregion
//**********
//********** Initialization Routine
protected override void Initialize()
{
Enabled = true;
CalculateOnBarClose = false;
ExitOnClose = false;
T3(period1, tcount1, vfactor1).Plots[0].Pen.Color = Color.Yellow;
T3(period2, tcount2, vfactor2).Plots[0].Pen.Color = Color.Green;
T3(period3, tcount3, vfactor3).Plots[0].Pen.Color = Color.Red;
Add(T3(period1, tcount1, vfactor1));
Add(T3(period2, tcount2, vfactor2));
Add(T3(period3, tcount3, vfactor3));
fastPrice = new DataSeries(this);
medPrice = new DataSeries(this);
slowPrice = new DataSeries(this);
if (Instrument.MasterInstrument.PointValue == 1000) // JPY pairs
{
digitSize = 3;
}
else
{
digitSize = 5;
}
pipSize = Instrument.MasterInstrument.PointValue;
}
//**********
//********** Main Routine
protected override void OnBarUpdate()
{
fastPrice.Set(Math.Round(T3(period1, tcount1, vfactor1)[0],digitSize));
medPrice.Set(Math.Round(T3(period2, tcount2, vfactor2)[0],digitSize));
medPrice.Set(Math.Round(T3(period3, tcount3, vfactor3)[0],digitSize));
DrawTextFixed("T3", "Fast:" + fastPrice + "Medium:" + medPrice + "Slow:" + slowPrice,TextPosition.TopLeft,Color.Yellow,new Font("Arial", 12),Color.Black,Color.Black,10);
}
//**********
//********** User Input Parameters
#region Properties
#endregion
} // End of public class
} // End of namespace
Comment