예제 #1
0
        public MockBaseDealingServer()
        {
            StockExchId = CodesStockExch._04_CryptoBitfinex;


            GlobalConfig = new CGlobalConfig();

            DictInstruments = new Dictionary <string, CInstrument>();

            /*  DictInstruments = new Dictionary<string, CInstrument>()
             * {
             *    {"BTCUSD", new CInstrument{ DecimalVolume = 3,
             *                                Min_step=0.1m,
             *                                RoundTo=1,
             *                                  minimum_order_size=0.002m
             *                                }
             *    }
             *
             * };
             */


            DBCommunicator = new CDBCommunicator("atfs", this);

            DBCommunicator.WaitReadyForOperations();

            Instruments = new CListInstruments(this, GlobalConfig);

            Instruments.LoadDataFromDB();


            //  Instruments = new CListInstruments(this, GlobalConfig);
        }
예제 #2
0
        public CTableAll_Trades(string name, IDealingServerForASTSAllTrades client)
            : base(name, client)
        {
            _client = client;

            _instruments = _client.Instruments;
            _dealBox     = _client.DealBoxInp;
        }
예제 #3
0
        public CTableExt_OrderBook(string name, IDealingServerForTableExt_OrderBook client,
                                   CStockBoxASTS stockBox, CListInstruments listInstruments)
            : base(name, client)
        {
            _stockBox        = stockBox;
            _listInstruments = listInstruments;

            client.IsStockOnline = true;
            client.EvStockOnline.Set();
        }
예제 #4
0
        public CPosBoxCrypto(IClientPositionsBoxCrypto client)
            : base(client)
        {
            _dealingserver = client;
            _instruments   = _dealingserver.Instruments;

            DictPos = new Dictionary <string, CRawPosition>();
            foreach (var kvp in _instruments)
            {
                DictPos[kvp.instrument] = new CRawPosition();
            }

            CreateListPos(client.StockExchId, client.Instruments);
        }
예제 #5
0
        public void CreateListPos(int stockExchId, CListInstruments listInstruments)
        {
            ListPos = new CListPositionInstrTotal(stockExchId);
            //changed 2018-05-22

            foreach (var inst in listInstruments)
            {
                if (inst.IsViewOnly == 0)
                {
                    ListPos.Lst.Add(new CPositionInstrTotal()
                    {
                        StockExchId = stockExchId,
                        Instrument  = inst.instrument,
                        Pos         = 0
                    });
                }
            }
        }
        public CPosistionsBoxASTS(IClientPositionsBoxASTS client)
            : base(client)
        {
            _client      = client;
            _instruments = client.Instruments;
            _alarmer     = client;
            _guiBox      = client.GUIBox;

            //TODO to base class
            DictPos = new Dictionary <string, CRawPosition>();
            foreach (var kvp in _instruments)
            {
                DictPos[kvp.instrument] = new CRawPosition();
            }

            _onlineDetector = new COnlineDetector(client.TriggerRecalcAllBots, EnmBotEventCode.OnPositionOnline,
                                                  parTimeAfterUpdateMs: 500, parTimeAfterObjectCreated: 8000);



            CreateListPos(_client.StockExchId, _instruments);
        }
 public CTableSecurities(string name, IAlarmable alarmer, CListInstruments instruments, int StockExchID)
     : base(name, alarmer)
 {
     _instruments = instruments;
     _stockExchID = StockExchID;
 }