Exemplo n.º 1
0
        public BitmexController()
        {
            var config = (BotcoinConfigSection)ConfigurationManager.GetSection("botcoin");

            _apiClient = new RestApiClient2(config.Connections.GetElement("WebApi").Url);
            Log        = new RestServiceEventLogger(_apiClient, DataType.ServiceName.BitmexBot);
            _wsServer  = new WebSocketServer(Log, config.Connections.GetElement("WebSocket").Url);
            _vwaps     = new DbIndicatorVwapLite[] { };

            _instrumentSettingsTimer = new Timer(config.BitmexBot.TimeoutHours * 3600000);
            _vwapGainsTimer          = new Timer(20000);

            _marginRequest = new MarginRequest(_apiClient);
            _walletRequest = new WalletRequest(_apiClient);
            _orderRequest  = new OrderRequest(_apiClient);
            _posRequest    = new PositionRequest(_apiClient);
            _vwapRequest   = new IndicatorRequest(_apiClient);

            _instrumentSettingsTimer.Elapsed += OnInstrumentSettingsTimerElapsed;
            _vwapGainsTimer.Elapsed          += OnVwapGainsTimerElapsed;
        }
Exemplo n.º 2
0
 public void SaveMargin(MarginRequest request)
 {
     _dbRepo.SaveMargin(request);
 }