private AccountCheckStream() { walletRepository = new WalletRepository(); accountRepository = AccountRepository.Instance; orderRepository = OrderRepository.Instance; profitCalculator = ProfitCalculator.Instance; tradeManager = ManagerTrade.Instance.tradeManager; brokerRepository = new BrokerRepository(); threadIntervalMils = AppConfig.GetIntParam("CheckLoop.Interval", 100); schedules = new[] { new Schedule(CheckOrders, AppConfig.GetIntParam("CheckLoop.IntervalOrders", 300)), new Schedule(CheckMargin, AppConfig.GetIntParam("CheckLoop.IntervalMargin", 15000)), new Schedule(CheckSwap, AppConfig.GetIntParam("CheckLoop.IntervalSwap", 1000)), new Schedule(RenewSubscriptions, AppConfig.GetIntParam("CheckLoop.UpdateSubscriptions", 1000)) }; // параметры начисления свопов var dicMetadata = brokerRepository.GetMetadataByCategory("SWAP"); object swapHourGmtObj, minutesToCheckSwapObj; if (!dicMetadata.TryGetValue("Hour.GMT", out swapHourGmtObj)) { swapHourGmtObj = 21; } swapCheckHourGmt = (int)swapHourGmtObj; if (!dicMetadata.TryGetValue("MinutesToCheck", out minutesToCheckSwapObj)) { minutesToCheckSwapObj = 0; } minutesToCheckSwap = (int)minutesToCheckSwapObj; }
private AccountCheckStream() { walletRepository = new WalletRepository(); accountRepository = AccountRepository.Instance; orderRepository = OrderRepository.Instance; profitCalculator = ProfitCalculator.Instance; tradeManager = ManagerTrade.Instance.tradeManager; brokerRepository = new BrokerRepository(); threadIntervalMils = AppConfig.GetIntParam("CheckLoop.Interval", 100); schedules = new[] { new Schedule(CheckOrders, AppConfig.GetIntParam("CheckLoop.IntervalOrders", 300)), new Schedule(CheckMargin, AppConfig.GetIntParam("CheckLoop.IntervalMargin", 15000)), new Schedule(CheckSwap, AppConfig.GetIntParam("CheckLoop.IntervalSwap", 1000)), new Schedule(RenewSubscriptions, AppConfig.GetIntParam("CheckLoop.UpdateSubscriptions", 1000)) }; // параметры начисления свопов var dicMetadata = brokerRepository.GetMetadataByCategory("SWAP"); object swapHourGmtObj, minutesToCheckSwapObj; if (!dicMetadata.TryGetValue("Hour.GMT", out swapHourGmtObj)) swapHourGmtObj = 21; swapCheckHourGmt = (int) swapHourGmtObj; if (!dicMetadata.TryGetValue("MinutesToCheck", out minutesToCheckSwapObj)) minutesToCheckSwapObj = 0; minutesToCheckSwap = (int)minutesToCheckSwapObj; }
public Game(IProfitCalculator profitCalculator, IPlayer player) { _profitCalculator = profitCalculator; _symbols = CreateSymbols(); _randomizer = new SymbolRandomizer(_symbols); _player = player; }
public TradeManager(ITradeSharpServerTrade proxyTrade, ITradeSharpAccount proxyAccount, IStorage<string, QuoteData> quoteStorage, Func<int, AccountGroup> getAccountGroup) { profitCalculator = ProfitCalculator.Instance; if (getAccountGroup == null) throw new ArgumentException("TradeManager ctor()", "getAccountGroup"); this.proxyTrade = proxyTrade; this.proxyAccount = proxyAccount; this.quoteStorage = quoteStorage; this.getAccountGroup = getAccountGroup; timeStarted = DateTime.Now; }
public static IProfitCalculator CreateInstance() { lock (_lock) { if (_instance is null) { _instance = new ProfitCalculator(); } return(_instance); } }
private ManagerTrade(Dictionary <string, IDealer> dealers) { accountRepository = AccountRepository.Instance; orderRepository = OrderRepository.Instance; profitCalculator = ProfitCalculator.Instance; walletRepository = new WalletRepository(); brokerRepository = new BrokerRepository(); this.dealers = dealers; foreach (var pair in dealers) { pair.Value.ServerInterface = this; } }
public TradeManager(ITradeSharpServerTrade proxyTrade, ITradeSharpAccount proxyAccount, IStorage <string, QuoteData> quoteStorage, Func <int, AccountGroup> getAccountGroup) { profitCalculator = ProfitCalculator.Instance; if (getAccountGroup == null) { throw new ArgumentException("TradeManager ctor()", "getAccountGroup"); } this.proxyTrade = proxyTrade; this.proxyAccount = proxyAccount; this.quoteStorage = quoteStorage; this.getAccountGroup = getAccountGroup; timeStarted = DateTime.Now; }
private ManagerTrade(bool initialize) { accountRepository = AccountRepository.Instance; orderRepository = OrderRepository.Instance; profitCalculator = ProfitCalculator.Instance; brokerRepository = new BrokerRepository(); walletRepository = new WalletRepository(); if (!initialize) { return; } InitializeDealers(); // инициализация сериализаторов SerializationWriter.TypeSurrogates.Add(new MarketOrderSerializer()); }
public ProfitController(IProfitCalculator calculator, IProfitView view) { _calculator = calculator; _view = view; _view.ShowResult(_calculator.CalculateResult(_view.GetRates())); }
public void Setup() { _profitCalculator = ProfitCalculator.CreateInstance(); }
public WalletManager() { walletRepository = new WalletRepository(); profitCalculator = ProfitCalculator.Instance; accountRepository = AccountRepository.Instance; }
public WalletManager() { walletRepository = new WalletRepository(); profitCalculator = ProfitCalculator.Instance; accountRepository = AccountRepository.Instance; }
private ManagerAccount() { profitCalculator = ProfitCalculator.Instance; accountRepository = AccountRepository.Instance; }
private ManagerAccount() { profitCalculator = ProfitCalculator.Instance; accountRepository = AccountRepository.Instance; }