public override void Initialization()
        {
            try
            {
                //Создаем индикаторы для торговой стратегии
                _top    = new BollingerBandsTop((int)Parameter(1), (int)Parameter(2));
                _bottom = new BollingerBandsBottom((int)Parameter(1), (int)Parameter(2));

                //Объем заявки
                _volume = (int)Parameter(3);

                //При остановке старегии сбрасываем индикаторы
                StrategyStateChanged += state =>
                {
                    if (state == StrategyState.NotActivated)
                    {
                        _top.Reset();
                        _bottom.Reset();
                    }
                };

                //Подписываемся на свечки
                NewCandle += ProcessCandle;
            }
            catch (Exception ex)
            {
                ExceptionMessage(ex, "Strategy");
            }
        }
Example #2
0
 public BollingerTopOnTicks(int period, int standardDeviation)
 {
     _bollingerBandsTop = new BollingerBandsTop(period, standardDeviation);
 }