public static List<Trade> EmaScalp(Parameter_EMA_Scalp P, List<Price> price, bool tradeOnly) { A_1 = Factory_Indicator.createEMA(P.A_EMA1, price); A_6 = Factory_Indicator.createEMA(P.A_EMA2, price); B_1 = Factory_Indicator.createEMA(P.B_EMA1, price); B_6 = Factory_Indicator.createEMA(P.B_EMA2, price); E1 = Factory_Indicator.createEMA(P.C_EMA, price); DateTime sd = E1[0].TimeStamp; CutToSize(sd); TradeStrategy _strategy = new TradeStrategy(price, P, B_6[0].TimeStamp, CalcTriggers,CalcTriggers2 ); _strategy.Calculate(); _T = _strategy.getStrategyList(); //for (int x = 0; x < _T.Count; x++) DP(x); // _strategy.ClearList(); //FOR SIMULATOR return GetTradeData(tradeOnly); // REAL TRADING // Clear();//FOR SIMULATOR return new List<Trade>(); }
public static List <Trade> EmaSar(Parameter_EMA_SAR P, List <Price> price, bool tradeOnly) { A_1 = Factory_Indicator.createEMA(P.A_EMA1, price); A_6 = Factory_Indicator.createEMA(P.A_EMA2, price); B_1 = Factory_Indicator.createEMA(P.B_EMA1, price); B_6 = Factory_Indicator.createEMA(P.B_EMA2, price); E1 = Factory_Indicator.createEMA(P.C_EMA, price); SAR = Factory_Indicator.createSAR(P.SAR_STEP, P.SAR_MAXP, price); DateTime sd = E1[0].TimeStamp; CutToSize(sd); TradeStrategy _strategy = new TradeStrategy(price, P, B_6[0].TimeStamp, CalcTriggers, CalcTriggers2); _strategy.Calculate(); _T = _strategy.getStrategyList(); //for (int x = 0; x < _T.Count; x++) DP(x); // _strategy.ClearList(); //FOR SIMULATOR return(GetTradeData(tradeOnly)); // REAL TRADING // Clear();//FOR SIMULATOR return(new List <Trade>()); }
public static List<Trade> MAMAScalp(Parameter_MAMA P, List<Price> price, bool tradeOnly) { A_1 = Factory_Indicator.createEMA(P.A_EMA1, price); A_6 = Factory_Indicator.createEMA(P.A_EMA2, price); B_1 = Factory_Indicator.createEMA(P.B_EMA1, price); B_6 = Factory_Indicator.createEMA(P.B_EMA2, price); E1 = Factory_Indicator.createEMA(P.C_EMA, price); MA = Factory_Indicator.createAdaptiveMA_MAMA(P.Fast, P.Slow, price); //StreamWriter sr = new StreamWriter(@"d:\MAMA.txt"); //foreach (var m in MA.Skip(1000)) //{ // sr.WriteLine(m.TimeStamp + "," + m.Price_Close + "," + m.Mama + "," + m.Fama);//+","+E1.Where(z=>z.TimeStamp==m.TimeStamp).First().Ema ); //} //sr.Close(); //Environment.Exit(0); DateTime sd = E1[0].TimeStamp; CutToSize(sd); TradeStrategy _strategy = new TradeStrategy(price, P, B_6[0].TimeStamp, CalcTriggers,CalcTriggers2 ); _strategy.Calculate(); _T = _strategy.getStrategyList(); //for (int x = 0; x < _T.Count; x++) DP(x); // _strategy.ClearList(); //FOR SIMULATOR return GetTradeData(tradeOnly); // REAL TRADING // Clear();//FOR SIMULATOR return new List<Trade>(); }
public static List <Trade> MAMAScalp(Parameter_MAMA P, List <Price> price, bool tradeOnly) { A_1 = Factory_Indicator.createEMA(P.A_EMA1, price); A_6 = Factory_Indicator.createEMA(P.A_EMA2, price); B_1 = Factory_Indicator.createEMA(P.B_EMA1, price); B_6 = Factory_Indicator.createEMA(P.B_EMA2, price); E1 = Factory_Indicator.createEMA(P.C_EMA, price); MA = Factory_Indicator.createAdaptiveMA_MAMA(P.Fast, P.Slow, price); //StreamWriter sr = new StreamWriter(@"d:\MAMA.txt"); //foreach (var m in MA.Skip(1000)) //{ // sr.WriteLine(m.TimeStamp + "," + m.Price_Close + "," + m.Mama + "," + m.Fama);//+","+E1.Where(z=>z.TimeStamp==m.TimeStamp).First().Ema ); //} //sr.Close(); //Environment.Exit(0); DateTime sd = E1[0].TimeStamp; CutToSize(sd); TradeStrategy _strategy = new TradeStrategy(price, P, B_6[0].TimeStamp, CalcTriggers, CalcTriggers2); _strategy.Calculate(); _T = _strategy.getStrategyList(); //for (int x = 0; x < _T.Count; x++) DP(x); // _strategy.ClearList(); //FOR SIMULATOR return(GetTradeData(tradeOnly)); // REAL TRADING // Clear();//FOR SIMULATOR return(new List <Trade>()); }