override protected void StrategyExecute() { StochSlowRule stochRule = new StochSlowRule(data.Bars, parameters[0], parameters[1], parameters[2]); for (int idx = 0; idx < data.Close.Count; idx++) { if (stochRule.isValid_forBuy(idx)) BuyAtClose(idx); if (stochRule.isValid_forSell(idx)) SellAtClose(idx); } }
override protected void StrategyExecute() { StochSlowRule stochRule = new StochSlowRule(data.Bars, parameters[0], parameters[1], parameters[2]); for (int idx = 0; idx < data.Close.Count; idx++) { if (stochRule.isValid_forBuy(idx)) { BuyAtClose(idx); } if (stochRule.isValid_forSell(idx)) { SellAtClose(idx); } } }
protected override void StrategyExecute() { //DataSeries sma20 = Indicators.SMA.Series(data.Close, parameters[0], ""); MACD_HistogramRule macdRule = new MACD_HistogramRule(data.Close, parameters[1], parameters[2], parameters[3]); StochSlowRule stochRule = new StochSlowRule(data.Bars, parameters[4], parameters[5], parameters[6]); for (int idx = 1; idx < data.Close.Count; idx++) { if (macdRule.isValid_forBuy(idx)&&stochRule.UpTrend(idx)) BuyAtClose(idx); if (macdRule.isValid_forSell(idx)) SellAtClose(idx); } }
protected override void StrategyExecute() { //DataSeries sma20 = Indicators.SMA.Series(data.Close, parameters[0], ""); MACD_HistogramRule macdHistogramRule = new MACD_HistogramRule(data.Close, parameters[1], parameters[2], parameters[3]); StochSlowRule stochSlowRule = new StochSlowRule(data.Bars, parameters[4], parameters[5], parameters[6]); for (int idx = 1; idx < data.Close.Count; idx++) { if (macdHistogramRule.isValid_forBuy(idx) && stochSlowRule.UpTrend(idx)) { BuyAtClose(idx); } if (macdHistogramRule.isValid_forSell(idx)) { SellAtClose(idx); } } }