Beispiel #1
0
        public LeechApp(ILeechConfig config, IBotManager botManager, IBotsConfiguration botsConfig, ITickDispatcher tickDisp, IDataStorage dataStorage,
                        IInstrumTable insTable, IStopOrderTable stopOrderTable, IOrderTable orderTable, ITradeTable tradeTable,
                        IHoldingTable holdingTable, ICashTable positionTable, AccountTable accountTable, IInsStoreData insStoreData, ILogger logger)
        {
            _config         = config;
            _scheduler      = new Scheduler(logger);
            _botsConfig     = botsConfig;
            _tickDispatcher = tickDisp;
            _botManager     = botManager;
            _dataStorage    = dataStorage;
            _accountTable   = accountTable;
            _instrumTable   = insTable;
            _orderTable     = orderTable;
            _tradeTable     = tradeTable;
            _stopOrderTable = stopOrderTable;
            _holdingTable   = holdingTable;
            _cashTable      = positionTable;
            _insStoreData   = insStoreData;
            _logger         = logger;
            _dataProtect    = IoC.Resolve <DataProtect>();
            _lpClientApp    = new LpClientApp(_dataProtect, _instrumTable, _accountTable, _stopOrderTable, _orderTable,
                                              _tradeTable, _cashTable, _holdingTable, _tickDispatcher, _logger);

            _allTradesData = new AllTradesData(_instrumTable, _insStoreData, _logger);
            _alorTrade     = new AlorTradeWrapper(_instrumTable, _stopOrderTable, _orderTable, _tradeTable,
                                                  _holdingTable, _cashTable, _accountTable,
                                                  _tickDispatcher, _config, _logger);
        }
Beispiel #2
0
 public DebugLogger(ILeechConfig config)
 {
     _logPath = config.GetLogPath();
     if (!Directory.Exists(_logPath))
     {
         Directory.CreateDirectory(_logPath);
     }
 }
Beispiel #3
0
        public LeechStorage(ILeechConfig config)
        {
            string dbpath = config.GetDbPath();

            if (!Directory.Exists(dbpath))
            {
                Directory.CreateDirectory(dbpath);
            }
            _dbfile = Path.Combine(dbpath, "leech.db");
        }
Beispiel #4
0
 public LeechPlatform(ITickDispatcher tickDisp, IInstrumTable insTable, IHoldingTable holdTable, IOrderTable orderTable, IAccountTable accountTable,
                      AlorTradeWrapper alorTrade, ILogger logger, IInsStoreBL insStoreBL, ILeechConfig leechConfig)
 {
     _tickDisp     = tickDisp;
     _instrumTable = insTable;
     _holdingTable = holdTable;
     _orderTable   = orderTable;
     _accountTable = accountTable;
     _alorTrade    = alorTrade;
     _logger       = logger;
     _insStoreBL   = insStoreBL;
     _leechConfig  = leechConfig;
     _barRows      = new List <BarRow>();
     _onTimer      = null;
     _onTimerTask  = null;
     _ins_onTick   = new Dictionary <int, OnTickDelegate>();
     _insID_pm     = new Dictionary <int, IPosManager>();
 }
Beispiel #5
0
        public InsStoreData(IInsStoreDA insStoreDA, InsStoreBL insStoreBL, IStorage storage, IRepositoryBL reposBL, ILeechConfig config, ILogger logger)
        {
            _insStoreDA = insStoreDA;
            _insStoreBL = insStoreBL;
            _storage    = storage;
            _reposBL    = reposBL;
            _config     = config;
            _logger     = logger;

            _tfs = new Timeframes[]
            {
                Timeframes.Min,
                Timeframes.Min5,
                Timeframes.Hour,
                Timeframes.Day
            };
            _insStore_barRow = new Dictionary <Common.Data.InsStore, BarRow>();
            _insID_barRows   = new Dictionary <int, List <BarRow> >();
        }
Beispiel #6
0
 public AlorTradeWrapper(IInstrumTable insTable, IStopOrderTable stopOrderTable, IOrderTable orderTable,
                         ITradeTable tradeTable, IHoldingTable holdingTable, ICashTable positionTable,
                         IAccountTable accountTable, ITickDispatcher tickDisp, ILeechConfig config, ILogger logger)
 {
     _instrumTable        = insTable;
     _stopOrderTable      = stopOrderTable;
     _orderTable          = orderTable;
     _tradeTable          = tradeTable;
     _holdingTable        = holdingTable;
     _positionTable       = positionTable;
     _accountTable        = accountTable;
     _tickDispatcher      = tickDisp;
     _leechConfig         = config;
     _logger              = logger;
     _secBoard            = _leechConfig.SecBoard;
     _addHours            = _leechConfig.CorrectHours;
     _startSessionMskTime = _leechConfig.StartSessionMskTime;
     _endSessionMskTime   = _leechConfig.EndSessionMskTime;
 }
Beispiel #7
0
 public BotsConfiguration(ILeechConfig config, ILogger logger)
 {
     _config      = config;
     _logger      = logger;
     _key_botconf = new Dictionary <string, BotConfig>();
 }