コード例 #1
0
 public FairPriceMaker(TradersSettings settings)
 {
     highLowPriceByTicker =
         settings.MoneyManagementSets.Tickers.ToDictionary(t => t.Id, t => new HighLowPrice {
         defaultPrice = t.DefaultPrice
     });
 }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
 /// <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;
 }
コード例 #4
0
 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);
 }
コード例 #5
0
ファイル: TraderPool.cs プロジェクト: Qurrex/matchingui
 /// <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);
 }
コード例 #6
0
ファイル: ServerStatPicker.cs プロジェクト: Qurrex/matchingui
 public ServerStatPicker(TradersSettings settings, Logger logMessage)
 {
     this.settings   = settings;
     this.logMessage = logMessage;
     filePath        = ExecutablePath.Combine("serverlog.json");
 }
コード例 #7
0
 public SinusoidPayloadCalculator(TradersSettings settings)
 {
     periodMs = settings.PayloadSets.SinusoidPeriodMs;
     interval = settings.PayloadSets.SleepInterval;
 }