Esempio n. 1
0
 public static FeedCommand<SubscribeInstrumentArgsBase> SubscribePrice(InstrumentDescriptor instrument)
 {
     return new FeedCommand<SubscribeInstrumentArgsBase>
         {
             cmd = SubscribeCommandParameter,
             args = new SubscribePriceArgs(instrument)
         };
 }
Esempio n. 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),
         };
 }
Esempio n. 3
0
 public async Task<InstrumentMatch> InstrumentSearch(InstrumentDescriptor instrumentItem)
 {
     return await InstrumentSearch(instrumentItem.Identifier, instrumentItem.MarketId.ToString(CultureInfo.InvariantCulture));
 }
Esempio n. 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)
 {
 }
Esempio n. 6
0
 protected InstrumentTick()
 {
     Instrument= new InstrumentDescriptor(int.MinValue, null);
 }
Esempio n. 7
0
 public SubscribeDepthArgs(InstrumentDescriptor instrument)
     : base(instrument, SubscribeType.Depth)
 {
 }
Esempio n. 8
0
 public SubscribeIndexArgs(InstrumentDescriptor instrument)
     : base(instrument, SubscribeType.Index)
 {
 }
Esempio n. 9
0
 public SubscribePriceArgs(InstrumentDescriptor instrument)
     : base(instrument, SubscribeType.Price)
 {
 }
Esempio n. 10
0
 public SubscribeTradeArgs(InstrumentDescriptor instrument)
     : base(instrument, SubscribeType.Trade)
 {
 }
Esempio n. 11
0
 public static FeedCommand<SubscribeInstrumentArgsBase> UnSubscribeTradingStatus(InstrumentDescriptor instrument)
 {
     return new FeedCommand<SubscribeInstrumentArgsBase>
     {
         cmd = UnSubscribeCommandParameter,
         args = new SubscribeTradingStatusArgs(instrument)
     };
 }