protected override void OnStateChange() { if (State == State.SetDefaults) { Description = @"Enter the description for your new custom Strategy here."; Name = "NineThirty"; Calculate = Calculate.OnEachTick; EntriesPerDirection = 1; EntryHandling = EntryHandling.AllEntries; IsExitOnSessionCloseStrategy = true; ExitOnSessionCloseSeconds = 30; IsFillLimitOnTouch = false; MaximumBarsLookBack = MaximumBarsLookBack.Infinite; OrderFillResolution = OrderFillResolution.Standard; Slippage = 0; StartBehavior = StartBehavior.WaitUntilFlat; TimeInForce = TimeInForce.Gtc; TraceOrders = false; RealtimeErrorHandling = RealtimeErrorHandling.StopCancelClose; StopTargetHandling = StopTargetHandling.PerEntryExecution; BarsRequiredToTrade = 20; // Disable this property for performance gains in Strategy Analyzer optimizations // See the Help Guide for additional information IsInstantiatedOnEachOptimizationIteration = true; ProfitTarget_1 = 3; ProfitTarget_2 = 100; ProfitTarget_3 = 12; ProfitOneListed = true; ProfitTwoListed = true; ProfitThreeListed = true; EMAPeriod = 2; OrderNum = 0; CurrentStage = 0; //WaitTillNext = false; HasCrossedBelow = true; BoughtWithOpen = false; OneFast = 2; OneSlow = 10; OneSmooth = 10; OpenPriceOffset = 7; OpenPriceOffset2 = 4; BoughtWithOpen2 = false; BoughtWithOpen3 = false; startTime = 63000; endTime = 93000; } else if (State == State.Configure) { } else if (State == State.DataLoaded) { CurrentDayOHL1 = CurrentDayOHL(Close); EMA1 = EMA(Close, Convert.ToInt32(EMAPeriod)); MACD1 = MACD(Close, Convert.ToInt32(OneFast), Convert.ToInt32(OneSlow), Convert.ToInt32(OneSmooth)); } }
protected override void OnStateChange() { if (State == State.SetDefaults) { Description = @"Enter the description for your new custom Strategy here."; Name = "ThreeEMA"; Calculate = Calculate.OnEachTick; EntriesPerDirection = 1; EntryHandling = EntryHandling.AllEntries; IsExitOnSessionCloseStrategy = true; ExitOnSessionCloseSeconds = 30; IsFillLimitOnTouch = false; MaximumBarsLookBack = MaximumBarsLookBack.TwoHundredFiftySix; OrderFillResolution = OrderFillResolution.Standard; Slippage = 0; StartBehavior = StartBehavior.WaitUntilFlat; TimeInForce = TimeInForce.Gtc; TraceOrders = false; RealtimeErrorHandling = RealtimeErrorHandling.StopCancelClose; StopTargetHandling = StopTargetHandling.PerEntryExecution; BarsRequiredToTrade = 20; // Disable this property for performance gains in Strategy Analyzer optimizations // See the Help Guide for additional information IsInstantiatedOnEachOptimizationIteration = true; EMA_Period1 = 5; EMA_Period2 = 30; EMA_Period3 = 60; Profit_Target = 10; } else if (State == State.Configure) { } else if (State == State.DataLoaded) { EMA1 = EMA(Close, Convert.ToInt32(EMA_Period3)); CurrentDayOHL1 = CurrentDayOHL(Close); EMA2 = EMA(Close, Convert.ToInt32(EMA_Period1)); EMA3 = EMA(Close, Convert.ToInt32(EMA_Period2)); } }