Example #1
0
 public Robot_Market(string platform)
 {
     if (string.IsNullOrEmpty(platform))
     {
         throw (new Exception("para is null"));
     }
     this.platform = platform;
     marketHepler  = new MarketHepler(platform);
     IsWS          = true;
     SymbolList    = new List <string>();
     Tickerdic     = new Dictionary <string, Ticker>();
     Depthdic      = new Dictionary <string, Depth>();
     Klinedic      = new Dictionary <string, List <Kline> >();
     InitTimer();
     InitWsEvent();
 }
Example #2
0
 private void HeplerTimer_Elapsed(object sender, ElapsedEventArgs e)
 {
     try
     {
         if (marketHepler?.IsOpened != true)
         {
             Stop();
             marketHepler.OnMessage -= MarketHepler_OnMessage;
             marketHepler.OnClosed  -= MarketHepler_OnClosed;
             marketHepler            = null;
             marketHepler            = new MarketHepler(platform);
             InitWsEvent();
             Run(SymbolList, IsWS);
         }
     }
     catch (Exception ex)
     {
         throw (ex);
     }
 }