Beispiel #1
0
 private void ExchangesTemporarilyDisabledChanged(string assetPairId,
                                                  ImmutableSortedDictionary <string, ExchangeExtPriceSettings> oldSettings,
                                                  ImmutableSortedDictionary <string, ExchangeExtPriceSettings> newSettings, string reason)
 {
     var(disable, enable) = oldSettings.FindChanges(newSettings, e => e.Key,
                                                    e => e.Value.Disabled.IsTemporarilyDisabled,
                                                    (o, n) => o == n, ChangeType.Add, ChangeType.Update)
                            .Select(t => t.New)
                            .Partition(ex => ex.Value.Disabled.IsTemporarilyDisabled);
     ExchangesStateChanged(assetPairId, disable.Select(t => t.Key), "disabled", reason);
     ExchangesStateChanged(assetPairId, enable.Select(t => t.Key), "enabled", reason);
 }
Beispiel #2
0
        private void CanPerformHedgingChanged(string assetPairId,
                                              ImmutableSortedDictionary <string, ExchangeExtPriceSettings> oldSettings,
                                              ImmutableSortedDictionary <string, ExchangeExtPriceSettings> newSettings, string reason)
        {
            var(hedgingOn, hedgingOff) = oldSettings.FindChanges(newSettings, e => e.Key,
                                                                 CanPerformHedging,
                                                                 (o, n) => o == n, ChangeType.Add, ChangeType.Update)
                                         .Select(t => t.New)
                                         .Partition(CanPerformHedging);

            ExchangesStateChanged(assetPairId, hedgingOn.Select(t => t.Key), "available for hedging", reason);
            ExchangesStateChanged(assetPairId, hedgingOff.Select(t => t.Key), "unavailable for hedging", reason);
        }