private void CheckActiveStakes() { var lastCandle = _candles.Last(); if (_ma8Stake != null) { _ma8Stake.AddCandle(lastCandle); if (_ma8Stake.Closed) { _closedStakes.Add(_ma8Stake); //OverallQuality.AddValue(_ma8Stake.Quality); _ma8Stake = null; } } if (_ma21Stake != null) { _ma21Stake.AddCandle(lastCandle); if (_ma21Stake.Closed) { _closedStakes.Add(_ma21Stake); OverallQuality.AddValue(_ma21Stake.Quality); _ma21Stake = null; } } }
private void AddStakes() { if (_ma21Stake == null) { var touchPrice = GetTouchPrice(_ma21); if (touchPrice.HasValue) { _ma21Stake = new Stake(touchPrice.Value, 7, StakeDirection, LastCandle, OnePip.Value); if (_ma8Stake != null) { _ma8Stake = null; } } else if (_ma8Stake == null) { touchPrice = GetTouchPrice(_ma8); if (touchPrice.HasValue) { _ma8Stake = new Stake(touchPrice.Value, 7, StakeDirection, LastCandle, OnePip.Value); } } } }