Ejemplo n.º 1
0
 internal static void IsInside(this UnitRecommendation ur, DataSeries data1, DataSeries data2, Candlestick LastClosedCandleStick, string description = "")
 {
     //data1 is EMA8
     //data2 is EMA13
     ur.Description = description;
     if (data2.Last(1) < data1.Last(1) &&
         LastClosedCandleStick.IsBetween(data1.Last(1), data2.Last(1), Library.enCandlestickPart.LowerShadow) &&
         LastClosedCandleStick.IsAbove(data1.Last(1), Library.enCandlestickPart.UpperShadow) &&
         LastClosedCandleStick.Direction == Library.enDirection.Bearish)
     {
         ur.Recommendation = BackToSquareOne.TradeRecommendation.Buy;
     }
     else if (data1.Last(1) < data2.Last(1) &&
              LastClosedCandleStick.IsBetween(data1.Last(1), data2.Last(1), Library.enCandlestickPart.UpperShadow) &&
              LastClosedCandleStick.IsBelow(data1.Last(1), Library.enCandlestickPart.LowerShadow) &&
              LastClosedCandleStick.Direction == Library.enDirection.Bullish)
     {
         ur.Recommendation = BackToSquareOne.TradeRecommendation.Sell;
     }
     else
     {
         ur.Recommendation = BackToSquareOne.TradeRecommendation.Nothing;
     }
 }