Example #1
0
 private void initializeTelegram()
 {
     try
     {
         if (this.Robot.IsBacktesting)
         {
             _nooptelegramClient = new NoopTelegram();
         }
         else
         {
             _telegramClient = new StrategyTelegram(this);
         }
     }
     catch (Exception ex)
     {
         Robot.Print("StrategyBase: Error starting telegram client {0}", ex.Message);
     }
 }
Example #2
0
 public void Dispose()
 {
     if (_telegramClient != null)
     {
         _telegramClient.Dispose();
         _telegramClient = null;
     }
     _onBarModules.Clear();
     _onTickModules.Clear();
     _allModules.Clear();
     _orderSpacingModules.Clear();
     _takeProfitModule = null;
     _stopLossModule   = null;
     _lotSizeModule    = null;
     foreach (var pipeline in _orderPipelines)
     {
         pipeline.Dispose();
     }
     _orderPipelines.Clear();
 }