Ejemplo n.º 1
0
 public SeriesData(IAccountDA accountDA)
 {
     _accountDA     = accountDA;
     _series        = new List <Series>();
     _series_values = new Dictionary <Series, List <SeriesValue> >();
     _series_vrdata = new Dictionary <Series, Tuple <ValueRow, Timeline, Func <decimal, ISeriesProps> > >();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Используется для динамических графиков.
 /// То есть предусмотрено динамическое изменение цен.
 /// </summary>
 /// <param name="instrumBL">Подсистема фин. инструментов</param>
 /// <param name="td">Диспетчер потока данных по сделкам</param>
 public ChartManager(IInstrumBL instrumBL, IInsStoreBL insStoreBL, IAccountDA accountDA, ITickDispatcher td)
 {
     _instrumBL      = instrumBL;
     _insStoreBL     = insStoreBL;
     _accountDA      = accountDA;
     _tickDispatcher = td;
     _depManager     = new DependencyManager();
     _factory        = new Factory(_srcProv, _depManager);
     _isDynamic      = true;
 }
Ejemplo n.º 3
0
 public ChartSystem(IChartDA chartDA, IInstrumBL instrumBL, IInsStoreBL insStoreBL, IAccountDA accountDA, IRepositoryBL reposBL,
                    ChartManagerCache cmCache, ITickDispatcher tickDisp)
 {
     _chartDA    = chartDA;
     _instrumBL  = instrumBL;
     _insStoreBL = insStoreBL;
     _accountDA  = accountDA;
     _reposBL    = reposBL;
     _cmCache    = cmCache;
     _tickDisp   = tickDisp;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Используется для статических графиков исторических данных.
 /// То есть динамическое изменение цены не предусмотрено.
 /// </summary>
 /// <param name="instrumBL">Подсистема фин. инструментов</param>
 /// <param name="startDate">Первый день отображаемых данных</param>
 /// <param name="endDate">Последний день отображаемых данных</param>
 public ChartManager(IInstrumBL instrumBL, IInsStoreBL insStoreBL, IAccountDA accountDA, DateTime startDate, DateTime endDate)
 {
     _instrumBL  = instrumBL;
     _insStoreBL = insStoreBL;
     _accountDA  = accountDA;
     _startDate  = startDate.Date;
     _endDate    = endDate.Date;
     _depManager = new DependencyManager();
     _factory    = new Factory(_srcProv, _depManager);
     _isDynamic  = false;
 }
Ejemplo n.º 5
0
        public Equity(IInsStoreBL insStoreBL, IInstrumBL instrumBL, IAccountDA accountDA)
        {
            _instrumBL  = instrumBL;
            _insStoreBL = insStoreBL;
            _accountDA  = accountDA;

            _cashRow      = new ValueRow();
            _portfolioRow = new ValueRow();
            _equityRow    = new ValueRow();
            _prices       = new Dictionary <int, BarRow>();
        }
Ejemplo n.º 6
0
        public TradeEngineData(IAccountDA accountDA)
        {
            _accountDA = accountDA;

            _account    = new Account();
            _cash       = new Cash();
            _holdings   = new List <Holding>();
            _orders     = new List <Order>();
            _stopOrders = new List <StopOrder>();
            _trades     = new List <Trade>();

            _modifiedOrders     = new List <Order>();
            _modifiedStopOrders = new List <StopOrder>();
        }
Ejemplo n.º 7
0
 public TestRunCtrl(IConsole console, IAccountDA accountDA, IAccountBL accountBL, IInstrumBL instrumBL, IInsStoreBL insStoreBL, ITickSourceBL tickSourceBL,
                    ITestConfigBL testConfigBL, ILogger logger, IConfig config, IPositionBL posBL, IRepositoryBL reposBL) : base(console)
 {
     _console      = console;
     _accountDA    = accountDA;
     _accountBL    = accountBL;
     _instrumBL    = instrumBL;
     _insStoreBL   = insStoreBL;
     _tickSourceBL = tickSourceBL;
     _testConfigBL = testConfigBL;
     _logger       = logger;
     _config       = config;
     _posBL        = posBL;
     _reposBL      = reposBL;
 }
Ejemplo n.º 8
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>();
        }
Ejemplo n.º 9
0
 public TestRun(IAccountBL accountBL, IAccountDA accountDA, IInstrumBL instrumBL, IInsStoreBL insStoreBL,
                ITickSourceBL tickSourceBL, ITestConfigBL testConfigBL, ILogger logger, IConfig config, IPositionBL posBL, IRepositoryBL reposBL)
 {
     _accountBL    = accountBL;
     _accountDA    = accountDA;
     _instrumBL    = instrumBL;
     _insStoreBL   = insStoreBL;
     _tickSourceBL = tickSourceBL;
     _testConfigBL = testConfigBL;
     _bot_platform = new Dictionary <IBot, ILeechPlatform>();
     _logger       = logger;
     _config       = config;
     _posBL        = posBL;
     _reposBL      = reposBL;
 }
Ejemplo n.º 10
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;
        }
Ejemplo n.º 11
0
 public HoldingTable(IAccountDA da)
 {
     _da = da;
 }
Ejemplo n.º 12
0
 public TradesLoader(IInstrumBL instrumBL, IAccountDA accountDA)
 {
     _instrumBL = instrumBL;
     _accountDA = accountDA;
     sb         = new StringBuilder();
 }
Ejemplo n.º 13
0
 public PositionCtrl(IConsole console, IInstrumBL instrumBL, IAccountDA accountDA)
 {
     _console   = console;
     _instrumBL = instrumBL;
     _accountDA = accountDA;
 }
Ejemplo n.º 14
0
 public CashTable(IAccountDA da)
 {
     _da = da;
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Конструктор подсистемы
 /// </summary>
 /// <param name="accountDA"></param>
 public AccountBL(IAccountDA accountDA)
 {
     _accountDA = accountDA;
 }
Ejemplo n.º 16
0
 public OrderTable(IAccountDA da)
 {
     _da = da;
 }
Ejemplo n.º 17
0
 public AccountTable(IAccountDA da)
 {
     _da           = da;
     _code_account = new Dictionary <string, Account>();
 }
Ejemplo n.º 18
0
 public TradeTable(IAccountDA da)
 {
     _da = da;
 }