Exemple #1
0
        static void UpdateOptionInfoDemo()
        {
            var repo = InstanceFactory.Get <OptionInfoRepository>(conn_type);

            repo.UpdateOptionInfo("510050.SH");
        }
Exemple #2
0
        static void Main(string[] args)
        {
            logger.Info("main method start...");
            Initializer.Initialize(ConnectionType.Default);

            //获取tick数据
            var optionSource  = new TypedParameter(typeof(IDataSource), InstanceFactory.Get <DefaultStockOptionTickDataSource>(new TypedParameter(typeof(ConnectionType), ConnectionType.Server170)));
            var optionRepo    = InstanceFactory.Get <StockOptionTickRepository>(conn_type, optionSource);
            var stockSource   = new TypedParameter(typeof(IDataSource), InstanceFactory.Get <DefaultStockTickDataSource>(new TypedParameter(typeof(ConnectionType), ConnectionType.Server170)));
            var stockTickRepo = InstanceFactory.Get <StockTickRepository>(conn_type, stockSource);
            //获取日线数据
            var stockDailysource  = new TypedParameter(typeof(IDataSource), InstanceFactory.Get <DefaultStockDailyDataSource>());
            var stockDailyRepo    = InstanceFactory.Get <StockDailyRepository>(conn_type, stockDailysource);
            var optionDailySource = new TypedParameter(typeof(IDataSource), InstanceFactory.Get <DefaultStockOptionDailyDataSource>());
            var optionDailyRepo   = InstanceFactory.Get <StockOptionDailyRepository>(conn_type, optionDailySource);
            var infoRepo          = InstanceFactory.Get <OptionInfoRepository>(conn_type);
            //获取分钟线数据
            var stockMinutelySource = new TypedParameter(typeof(IDataSource), InstanceFactory.Get <DefaultStockMinuteDataSource>());
            var stockMinutelyRepo   = InstanceFactory.Get <StockMinuteRepository>(conn_type, stockMinutelySource);
            //获取日期数据
            TransactionDateTimeRepository dateRepo = new TransactionDateTimeRepository(ConnectionType.Default);

            DateUtils.setTradeDays(dateRepo.GetStockTransactionDate("2007-01-01".ToDateTime(), "2019-12-31".ToDateTime()));

            //StockTickToMinute myData = new StockTickToMinute(dateRepo,stockDailyRepo,stockMinutelyRepo,stockTickRepo, "2016-02-01".ToDateTime(), "2019-01-14".ToDateTime());

            OptionMonitor50ETF2019 optionMonitor = new OptionMonitor50ETF2019(infoRepo, dateRepo, stockDailyRepo, stockMinutelyRepo, optionDailyRepo, "2015-02-09".ToDateTime(), "2019-01-14".ToDateTime());

            //trendT0 myt0 = new trendT0(stockMinutelyRepo, stockDailyRepo, "000016.SH", "2016-02-01".ToDateTime(), "2019-01-14".ToDateTime());


            //DualTrust dt0 = new DualTrust(stockMinutelyRepo, stockDailyRepo, "IF.CFE", "IF.CFE");
            //dt0.compute("2016-02-23".ToDateTime(), "2016-07-29".ToDateTime());

            //pairtradingDaily2 mypair = new pairtradingDaily2(stockDailyRepo,"600030.SH", "601688.SH");
            //mypair = new pairtradingDaily2(stockDailyRepo, "000333.SZ", "000651.SZ");
            //mypair = new pairtradingDaily2(stockDailyRepo, "601398.SH", "601939.SH");
            //mypair = new pairtradingDaily2(stockDailyRepo, "601318.SH", "601601.SH");
            //mypair.compute("2010-01-01".ToDateTime(), "2018-12-28".ToDateTime());
            //RBreakStrategy mybreak = new RBreakStrategy(stockMinutelyRepo, stockDailyRepo, "IC.CFE");
            //mybreak.compute("2016-01-01".ToDateTime(), "2018-11-20".ToDateTime());
            //DiagonalSpread backtest = new DiagonalSpread(stockMinutelyRepo, stockDailyRepo, "510050.SH");
            //backtest.compute("2016-01-01".ToDateTime(), "2018-09-25".ToDateTime());
            //VolumeDistribitionStrategy vd = new VolumeDistribitionStrategy(stockMinutelyRepo, stockDailyRepo, "510050.SH");
            //vd.compute("2016-01-01".ToDateTime(), "2018-11-20".ToDateTime());
            //TDstrategy td = new TDstrategy(stockMinutelyRepo, stockDailyRepo, "RB.SHF");
            //td.compute("2016-01-01".ToDateTime(), "2018-11-27".ToDateTime());
            //CallDeltaHedge hedgeDemo = new CallDeltaHedge(stockTickRepo, stockDailyRepo, "510050.SH", 60);
            //hedgeDemo.compute("2018-01-10".ToDateTime(), "2018-08-10".ToDateTime());
            //var twap = new TWAP(stockTickRepo,dateRepo, stockMinutelyRepo,"603939.SH");
            //twap.computeTWAP("2018-01-01".ToDateTime(), "2018-06-06".ToDateTime());
            //var twap = new STWAP(stockTickRepo, dateRepo, "000544.SZ");
            //twap.computeSTWAP("2018-06-20".ToDateTime(), "2018-06-20".ToDateTime());
            //twap = new STWAP(stockTickRepo, dateRepo, "300274.SZ");
            //twap.computeSTWAP("2015-01-01".ToDateTime(), "2018-06-06".ToDateTime());
            //twap = new STWAP(stockTickRepo, dateRepo, "000738.SZ");
            //twap.computeSTWAP("2015-01-01".ToDateTime(), "2018-06-06".ToDateTime());
            //twap = new STWAP(stockTickRepo, dateRepo, "300230.SZ");
            //twap.computeSTWAP("2015-01-01".ToDateTime(), "2018-06-06".ToDateTime());

            logger.Info("main method end...");
        }
Exemple #3
0
        static void UpdateStockInfoDemo()
        {
            var repo = InstanceFactory.Get <StockInfoRepository>(conn_type);

            repo.UpdateStockInfoToNow();
        }