Exemplo n.º 1
0
 internal SubscriptionMessage WithMarketDataFilter(MarketDataFilter marketDataFilter)
 {
     if (marketDataFilter != null)
     {
         MarketDataFilter = marketDataFilter;
     }
     return(this);
 }
Exemplo n.º 2
0
 private void MergeFields(MarketDataFilter other)
 {
     InitializedFields();
     if (other?.Fields != null)
     {
         Fields.UnionWith(other.Fields);
     }
 }
Exemplo n.º 3
0
        public async Task Subscribe(MarketFilter marketFilter, MarketDataFilter dataFilter)
        {
            _requestId++;
            var subscriptionMessage = new SubscriptionMessage("marketSubscription", _requestId)
                                      .WithMarketFilter(marketFilter)
                                      .WithMarketDataFilter(dataFilter);
            await Writer.WriteLineAsync(subscriptionMessage.ToJson());

            _subscriptionMessages.Add(_requestId, subscriptionMessage);
        }
Exemplo n.º 4
0
 private void MergeLadderLevels(MarketDataFilter other)
 {
     if (other?.LadderLevels == null)
     {
         return;
     }
     if (LadderLevelsEmpty())
     {
         LadderLevels = other.LadderLevels;
     }
     if (LadderLevels != null)
     {
         LadderLevels = Math.Max((int)LadderLevels, (int)other.LadderLevels);
     }
 }
Exemplo n.º 5
0
 public void Merge(MarketDataFilter other)
 {
     MergeFields(other);
     MergeLadderLevels(other);
 }