Exemplo n.º 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);
        }
Exemplo n.º 2
0
        public CLogger(string fileName, bool flushMode = true, string subDir = "", bool useMicroseconds = false)
        {
            _subDir = subDir;

            m_fileName        = fileName;
            m_flushMode       = flushMode;
            m_useMicroseconds = useMicroseconds;

            string m_rootDir = Application.StartupPath;
            // _creationTime = DateTime.Now;


            string        pathToConfig = CUtil.GetConfigDir() + @"\globalSettings.xml"; //System.AppDomain.CurrentDomain.BaseDirectory + @"config\globalSettings.xml";
            CGlobalConfig GlobalConfig = new CGlobalConfig(pathToConfig);

            CSerializator.Read <CGlobalConfig>(ref GlobalConfig);


            //       CSerializator.Write<CGlobalConfig>(ref GlobalConfig);

            if (GlobalConfig.LogExternal)
            {
                //string stEnvPathToLog = GlobalConfig.EnvVarLogFilePath;
                stLogDir = CUtil.GetLogDir() + "\\"; ///      Environment.GetEnvironmentVariable(stEnvPathToLog);
            }
            else
            {
                stLogDir = m_rootDir + "\\log\\";
            }


            CreateNewFile(bInitial: true);
        }
Exemplo n.º 3
0
        private void ReadGlobalConfig()
        {
            string pathFile = CUtil.GetConfigDir() + @"\globalSettings.xml";

            _globalConfig = new CGlobalConfig(pathFile);
            CSerializator.Read <CGlobalConfig>(ref _globalConfig);
        }
Exemplo n.º 4
0
        public MainWindow()
        {
            InitializeComponent();
            Closing += OnWindowClosing;

            string        pathToConfig = CUtil.GetConfigDir() + @"\globalSettings.xml"; //System.AppDomain.CurrentDomain.BaseDirectory + @"config\globalSettings.xml";
            CGlobalConfig GlobalConfig = new CGlobalConfig(pathToConfig);

            CSerializator.Read <CGlobalConfig>(ref GlobalConfig);



            (new Thread(ThreadTCPClient)).Start();


            Stock.ModelMarket = modelMarket;

            Stock.SetParameters(10);
            Stock.CreateStockRecords();
        }
        public CListInstruments(/*CDBCommunicator dbCommunicator,
                                 * Dictionary<string, long> dictIsin,
                                 * Dictionary<long, string> dictIsin_id,
                                 * ref bool isDictIsinAvail*/
            IClientInstruments client,
            CGlobalConfig globalConfig

            )
            : base()
        {
            _client         = client;
            _dbCommunicator = _client.DBCommunicator;
            _globalConfig   = globalConfig;
            //dictIsin = _client.DictInstr_IsinId;
            //_dictIsin_id = _client.DictIsin_id;
            InitInstAvailability();

            _dictInstruments = _client.DictInstruments;


            _logger = new CLogger("CListInstruments");
        }