public virtual JsonResult GetIntruments(InstrumentRequestModel model)
 {
     var instruments = Streamer.GetOrCreate(model.ConnectionId)
         .GetInstruments()
         .Select(i => new { i.Symbol, TimeFrame = Enum.GetName(typeof(TimeFrame), i.TimeFrame), i.Range, i.Available });
     return new JsonResult
     {
         Data = instruments,
         JsonRequestBehavior = JsonRequestBehavior.AllowGet
     };
 }
 public virtual JsonResult GetInstrument(InstrumentRequestModel model)
 {
     if (String.IsNullOrEmpty(model.Symbol))
         throw new ArgumentNullException("symbol");
     var instrument = Streamer.GetOrCreate(model.ConnectionId).GetInstruments().First(i => i.Symbol == model.Symbol);
     return new JsonResult
     {
         Data = new { instrument.Symbol, TimeFrame = Enum.GetName(typeof(TimeFrame), instrument.TimeFrame), instrument.Range },
         JsonRequestBehavior = JsonRequestBehavior.AllowGet
     };
 }
 public virtual EmptyResult SubscribeOnHistory(InstrumentRequestModel model)
 {
     Streamer.GetOrCreate(model.ConnectionId).SubscribeOnHistory(model.Symbol, model.TimeFrame);
     return new EmptyResult();
 }