Example #1
0
 public InstrumTable(IInstrumDA da, IStorage storage, ILogger logger)
 {
     _da             = da;
     _storage        = storage;
     _logger         = logger;
     _ticker_instrum = new Dictionary <string, Instrum>();
     _insID_instrum  = new Dictionary <int, Instrum>();
 }
Example #2
0
        public ImportLeech(IInstrumDA instrumDA, IAccountDA accountDA, IConfig config, ITickHistoryDA tickHistoryDA,
                           IReplicationBL replBL)
        {
            _instrumDA     = instrumDA;
            _accountDA     = accountDA;
            _config        = config;
            _tickHistoryDA = tickHistoryDA;
            _replBL        = replBL;

            _instrum_rid_lid   = new Dictionary <int, int>();
            _account_rid_lid   = new Dictionary <int, int>();
            _stoporder_rid_lid = new Dictionary <int, int>();
            _order_rid_lid     = new Dictionary <int, int>();
            _trade_rid_lid     = new Dictionary <int, int>();
        }
Example #3
0
        public PositionTest()
        {
            DbContextOptionsBuilder <DaContext> builder = new DbContextOptionsBuilder <DaContext>();

            builder.UseNpgsql("Username=postgres;Password=123;Host=localhost;Port=5432;Database=pulxer_test");
            _options = builder.Options;

            _insDA      = new InstrumDA(_options);
            _accountDA  = new AccountDA(_options);
            _positionDA = new PositionDA(_options);

            // создание
            var gazp = _insDA.GetInstrum(0, "GAZP");

            if (gazp == null)
            {
                _gazpID = _insDA.InsertInstrum("GAZP", "Газпром", "Газпром", 10, 2, 1);
            }
            else
            {
                _gazpID = gazp.InsID;
            }

            var lkoh = _insDA.GetInstrum(0, "LKOH");

            if (lkoh == null)
            {
                _lkohID = _insDA.InsertInstrum("LKOH", "Лукойл", "Лукойл", 1, 0, 0);
            }
            else
            {
                _lkohID = lkoh.InsID;
            }

            _accountID = _accountDA.CreateAccount("", "", 0, false, Common.Data.AccountTypes.Test).AccountID;
        }
Example #4
0
 public SyncBL(IInstrumDA instrumDA)
 {
     _instrumDA = instrumDA;
 }
Example #5
0
 public InstrumBL(IInstrumDA instrumDA, IInsStoreDA insStoreDA)
 {
     _instrumDA  = instrumDA;
     _insStoreDA = insStoreDA;
 }
Example #6
0
 public InstrumCtrl(IConsole console, IInstrumDA instrumDA)
 {
     _console   = console;
     _instrumDA = instrumDA;
 }