for some reason, it keeps selling ...although should do nothing ...
can someone help ?
is there soemthing i did not read properly ?
thanks very much
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 SlowStochasticSignal1 : Strategy { #region Variables // Wizard generated variables private int slowK = 13; private int slowD = 9; private int smoothD = 6; // User defined variables (add any user defined variables below) #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() { //Stochastics(smoothD, slowK, slowD).Plot[0].Pen.Color = Color.Beige; Add(Stochastics(6,13,9)); Add(SMA(13)); CalculateOnBarClose = true; SetProfitTarget(CalculationMode.Ticks,30); } /// <summary> /// Called on each bar update event (incoming tick) /// </summary> protected override void OnBarUpdate() { if (1 == 2) ; { EnterShort(1,"short"); } } #region Properties public int Slowk { get { return slowK; } set { slowK = Math.Max(1, value); } } public int SlowD { get { return slowD; } set { slowD = Math.Max(1, value); } } public int SmoothD { get { return smoothD; } set { smoothD = Math.Max(1, value); } } #endregion } }
Comment