public TrendStateAnalyzer() { _ma8 = new EMACalculator(8); _ma21 = new EMACalculator(21); _candles = new List <CandleDTO>(); _closedStakes = new List <Stake>(); OverallQuality = new EMACalculator(5); OnePip = new Lazy <float>(CalculateOnePip); }
private float?GetTouchPrice(EMACalculator ema) { if (TrendDirection == Direction.Up) { if (LastCandle.Low - ema.Value <= OnePip.Value * 2) { return(ema.Value); } } else { if (ema.Value - LastCandle.High <= OnePip.Value * 2) { return(ema.Value); } } return(null); }