public FairPriceMaker(TradersSettings settings) { highLowPriceByTicker = settings.MoneyManagementSets.Tickers.ToDictionary(t => t.Id, t => new HighLowPrice { defaultPrice = t.DefaultPrice }); }
/// <summary> /// make default settings object - e.g., when the settings file is corrupted or missed /// </summary> public static TradersSettings MakeDefaultSettings() { var sets = new TradersSettings(); sets.MoneyManagementSets.Tickers = new List <Ticker> { new Ticker { Name = "BTC/USD", Id = 1, DefaultPrice = 15000, PriceStep = 0.01, MinVolume = 0.00000001 }, new Ticker { Name = "ETH/USD", Id = 2, DefaultPrice = 1000, PriceStep = 0.01, MinVolume = 0.00000001 } }; return(sets); }
/// <summary> /// copy just the common part of the settings into the target object /// </summary> public void CopyCommonSettingsToTarget(TradersSettings target) { target.Uri = Uri; target.StatUri = StatUri; target.LogServerStatistics = LogServerStatistics; target.LoggingLevel = LoggingLevel; target.StatisticsTimeframeSeconds = StatisticsTimeframeSeconds; target.TestDurationSeconds = TestDurationSeconds; }
public Trader(Connection connection, Statistics statistics, TradersSettings sets, FairPriceMaker priceMaker, TraderModusOperandi modusOperandi, int seqNum, int tradersTotal) { this.connection = connection; this.statistics = statistics; this.priceMaker = priceMaker; this.modusOperandi = modusOperandi; this.seqNum = seqNum; this.tradersTotal = tradersTotal; settings = sets; sinusPayloadCalc = new SinusoidPayloadCalculator(sets); tradeThread = new Thread(ThreadRoutine); }
/// <summary> /// read test's settings - "trader" threads, payload, pricing, logging etc /// </summary> /// <returns></returns> private void ReadSettings() { settings = TradersSettings.ReadSettings(); tickerById = settings.MoneyManagementSets.Tickers.ToDictionary(t => t.Id, t => t); }
public ServerStatPicker(TradersSettings settings, Logger logMessage) { this.settings = settings; this.logMessage = logMessage; filePath = ExecutablePath.Combine("serverlog.json"); }
public SinusoidPayloadCalculator(TradersSettings settings) { periodMs = settings.PayloadSets.SinusoidPeriodMs; interval = settings.PayloadSets.SleepInterval; }