Exemple #1
0
        public RealtimeDataManagement()
        {
            InitializeComponent();

            cqgDataManagement = new CQGDataManagement(this);

            MongoDBConnectionAndSetup mongoDBConnectionAndSetup = new MongoDBConnectionAndSetup();
            //mongoDBConnectionAndSetup.connectToMongoDB();
            //mongoDBConnectionAndSetup.createDocument();
            //mongoDBConnectionAndSetup.dropCollection();

            var contextTMLDB = new DataClassesTMLDBDataContext(
                System.Configuration.ConfigurationManager.ConnectionStrings["TMLDBConnectionString"].ConnectionString);
            TMLDBReader TMLDBReader = new TMLDBReader(contextTMLDB);



            bool gotInstrumentList = TMLDBReader.GetTblInstruments(ref cqgDataManagement.instrumentHashTable,
                                                                   ref cqgDataManagement.instrumentList);

            Console.WriteLine(cqgDataManagement.instrumentList[0].description);

            AsyncTaskListener.Updated += AsyncTaskListener_Updated;

            testLoadIn();

            testGetData();

            //mongoDBConnectionAndSetup.createDoc();
            //mongoDBConnectionAndSetup.getDocument();
        }
Exemple #2
0
        private void testGetData()
        {
            MongoDBConnectionAndSetup mongoDBConnectionAndSetup = new MongoDBConnectionAndSetup();

            var filterBuilder = Builders <Mongo_OptionSpreadExpression> .Filter;
            var filter        = filterBuilder.Ne("Id", "barf");

            var testExpression = mongoDBConnectionAndSetup.MongoDataCollection.Find(filter).SingleOrDefault();

            Console.WriteLine(testExpression.cqgSymbol);
        }
Exemple #3
0
        private void testLoadIn()
        {
            MongoDBConnectionAndSetup mongoDBConnectionAndSetup = new MongoDBConnectionAndSetup();

            Mongo_OptionSpreadExpression osefdb = new Mongo_OptionSpreadExpression();


            osefdb.cqgSymbol  = "F.EPU16";
            osefdb.instrument = cqgDataManagement.instrumentHashTable[11];

            //mongoDBConnectionAndSetup.MongoDataCollection.ReplaceOne(
            //    item => item.cqgSymbol == osefdb.cqgSymbol,
            //    osefdb,
            //    new UpdateOptions { IsUpsert = true });

            mongoDBConnectionAndSetup.MongoDataCollection.InsertOne(osefdb);
        }