Example #1
0
 public static FeedCommand<SubscribeInstrumentArgsBase> SubscribePrice(InstrumentDescriptor instrument)
 {
     return new FeedCommand<SubscribeInstrumentArgsBase>
         {
             cmd = SubscribeCommandParameter,
             args = new SubscribePriceArgs(instrument)
         };
 }
Example #2
0
 /// <summary>
 /// Returns an array of commands to subscribe everything for instrument
 /// https://api.test.nordnet.se/projects/api/wiki/Feed_API_documentation#The-public-trade-and-price-feed
 /// </summary>
 /// <param name="instrument"></param>
 /// <returns></returns>
 public static FeedCommand<SubscribeInstrumentArgsBase>[] SubscribeAll(InstrumentDescriptor instrument)
 {
     return new[]
         {
             SubscribePrice(instrument),
             SubscribeDepth(instrument),
             SubscribeTrade(instrument),
             SubscribeIndex(instrument),
             SubscribeTradingStatus(instrument),
         };
 }
Example #3
0
 public async Task<InstrumentMatch> InstrumentSearch(InstrumentDescriptor instrumentItem)
 {
     return await InstrumentSearch(instrumentItem.Identifier, instrumentItem.MarketId.ToString(CultureInfo.InvariantCulture));
 }
Example #4
0
 /// <summary>
 /// https://api.test.nordnet.se/projects/api/wiki/REST_API_documentation#Multiple-instrument-lookup
 /// </summary>
 /// <returns></returns>
 public async Task<List<InstrumentMatch>> InstrumentSearch(InstrumentDescriptor[] descriptors)
 {
     var request = new RestRequest("instruments", Method.GET);
     var sb = new StringBuilder();
     foreach (var descriptor in descriptors)
     {
         sb.AppendFormat("{0},{1}", descriptor.MarketId, descriptor.Identifier);
         if (descriptor != descriptors.Last())
             sb.Append(";");
     }
     request.AddParameter("list", sb.ToString());
     IRestResponse<List<InstrumentMatch>> response = await Client.ExecuteTaskAsync<List<InstrumentMatch>>(request);
     ResetTouchTimer();
     return response.Data;
 }
 public SubscribeTradingStatusArgs(InstrumentDescriptor instrument)
     : base(instrument, SubscribeType.TradingStatus)
 {
 }
Example #6
0
 protected InstrumentTick()
 {
     Instrument= new InstrumentDescriptor(int.MinValue, null);
 }
Example #7
0
 public SubscribeDepthArgs(InstrumentDescriptor instrument)
     : base(instrument, SubscribeType.Depth)
 {
 }
Example #8
0
 public SubscribeIndexArgs(InstrumentDescriptor instrument)
     : base(instrument, SubscribeType.Index)
 {
 }
Example #9
0
 public SubscribePriceArgs(InstrumentDescriptor instrument)
     : base(instrument, SubscribeType.Price)
 {
 }
Example #10
0
 public SubscribeTradeArgs(InstrumentDescriptor instrument)
     : base(instrument, SubscribeType.Trade)
 {
 }
Example #11
0
 public static FeedCommand<SubscribeInstrumentArgsBase> UnSubscribeTradingStatus(InstrumentDescriptor instrument)
 {
     return new FeedCommand<SubscribeInstrumentArgsBase>
     {
         cmd = UnSubscribeCommandParameter,
         args = new SubscribeTradingStatusArgs(instrument)
     };
 }