Example #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);
        }
Example #2
0
        public LeechService(ILeechApp app, ILogger logger)
        {
            InitializeComponent();

            _app         = app;
            _logger      = logger;
            _dataProtect = IoC.Resolve <DataProtect>();
        }
Example #3
0
        /// <summary>
        /// Получить параметры соединения с сервером pulxer
        /// </summary>
        /// <param name="server">Url сервера</param>
        /// <param name="login">Логин</param>
        /// <param name="password">Пароль</param>
        /// <returns>true - успешно, false - данные получить не удалось</returns>
        public bool GetPulxerParams(out string server, out string login, out string password)
        {
            server = login = password = "";
            string data = _reposBL.GetStrParam(PULXER_CONNECT_KEY);

            if (string.IsNullOrEmpty(data))
            {
                return(false);
            }

            return(DataProtect.Decrypt(data, out server, out login, out password));
        }
Example #4
0
        /// <summary>
        /// Сохранить параметры соединения с сервером Pulxer
        /// </summary>
        /// <param name="server">Url сервера</param>
        /// <param name="login">Логин</param>
        /// <param name="password">Пароль</param>
        /// <param name="isLocalMachineProtection">Уровень защиты (на уровне компьютера или на уровне пользователя)</param>
        public void SetPulxerParams(string server, string login, string password, bool isLocalMachineProtection = false)
        {
            string data = DataProtect.Encrypt(server, login, password, isLocalMachineProtection);

            _reposBL.SetStrParam(PULXER_CONNECT_KEY, data);
        }