Example #1
0
 public override void GotTick(Tick k)
 {
     // if we don't have bar data, request historical data
     if (_blt[k.symbol].Count == 0)
     {
         D(k.symbol + " no bars found, requesting...");
         sendmessage(MessageTypes.BARREQUEST, BarImpl.BuildBarRequest(k.symbol, BarInterval.Hour));
     }
     D(k.symbol + " bar count: " + _blt[k.symbol].Count);
     // update whatever data we have with ticks
     _blt.newTick(k);
 }
 public override void GotTick(Tick k)
 {
     // if we don't have bar data, request historical data
     if (_blt[k.symbol].Count == 0)
     {
         if (barRequestedFlag == 0)
         {
             D(k.symbol + " no bars found, requesting...");
             sendmessage(MessageTypes.BARREQUEST, BarImpl.BuildBarRequest(k.symbol, BarInterval.Day, 20120105));
             barRequestedFlag += 1;
         }
         else
         {
             D("Waiting for Broker backfill");
         }
     }
     D(k.symbol + " bar count: " + _blt[k.symbol].Count);
     // update whatever data we have with ticks
     _blt.newTick(k);
 }