private static void ComposeSqlServer()
        {
            var reader    = new SqlServerReader(ConfigurationManager.AppSettings["sqlServerConnectionString"]);
            var viewModel = new PetsViewModel(reader);

            Application.Current.MainWindow = new PetViewerWindow(viewModel);
        }
Exemple #2
0
 public BondInfoRepository(Infrastructure.ConnectionType type)
 {
     windReader = new WindReader();
     sqlWriter  = new SqlServerWriter(type);
     sqlReader  = new SqlServerReader(type);
     dateRepo   = new TransactionDateTimeRepository(type);
 }
 public StockOptionDailyRepository(QuantitativeAnalysis.DataAccess.Infrastructure.ConnectionType type, IDataSource dataSource)
 {
     sqlReader       = new SqlServerReader(type);
     sqlWriter       = new SqlServerWriter(type);
     dateRepo        = new TransactionDateTimeRepository(type);
     this.dataSource = dataSource;
 }
 public DualTrust2(StockMinuteRepository stockMinutelyRepo, StockDailyRepository stockDailyRepo)
 {
     this.stockMinutelyRepo = stockMinutelyRepo;
     this.stockDailyRepo    = stockDailyRepo;
     dateRepo  = new TransactionDateTimeRepository(ConnectionType.Default);
     sqlWriter = new SqlServerWriter(ConnectionType.Server84);
     sqlReader = new SqlServerReader(ConnectionType.Local);
 }
Exemple #5
0
 public StockWithVolatility2(StockMinuteRepository stockMinutelyRepo, StockDailyRepository stockDailyRepo, TransactionDateTimeRepository dateRepo)
 {
     this.stockMinutelyRepo = stockMinutelyRepo;
     this.stockDailyRepo    = stockDailyRepo;
     this.dateRepo          = dateRepo;
     sqlWriter = new SqlServerWriter(ConnectionType.Server84);
     sqlReader = new SqlServerReader(ConnectionType.Local);
 }
Exemple #6
0
 public StockTickRepository(QuantitativeAnalysis.DataAccess.Infrastructure.ConnectionType type, IDataSource ds)
 {
     transDateRepo = new TransactionDateTimeRepository(type);
     sqlReader     = new SqlServerReader(type);
     sqlWriter     = new SqlServerWriter(type);
     dataSource    = ds;
     redisWriter   = new RedisWriter();
     redisReader   = new RedisReader();
 }
 public ETFConsitituentDailyRepository(ConnectionType type, DefaultETFConstituentDailyDataSource ds)
 {
     dateTimeRepo = new TransactionDateTimeRepository(type);
     sqlWriter    = new SqlServerWriter(type);
     sqlReader    = new SqlServerReader(type);
     redisReader  = new RedisReader();
     redisWriter  = new RedisWriter();
     dataSource   = ds;
 }
 public ivixMinutely(OptionInfoRepository infoRepo, StockMinuteRepository stockRepo, double rate = 0.04)
 {
     this.infoRepo  = infoRepo;
     this.stockRepo = stockRepo;
     this.rate      = rate;
     dateRepo       = new TransactionDateTimeRepository(ConnectionType.Default);
     sqlWriter      = new SqlServerWriter(ConnectionType.Server84);
     sqlReader      = new SqlServerReader(ConnectionType.Local);
 }
Exemple #9
0
 public RBreakStrategy(StockMinuteRepository stockMinutelyRepo, StockDailyRepository stockDailyRepo, string code)
 {
     this.stockMinutelyRepo = stockMinutelyRepo;
     this.stockDailyRepo    = stockDailyRepo;
     dateRepo  = new TransactionDateTimeRepository(ConnectionType.Default);
     this.code = code;
     sqlWriter = new SqlServerWriter(ConnectionType.Server84);
     sqlReader = new SqlServerReader(ConnectionType.Local);
 }
 public Intraday1(StockMinuteRepository stockMinutelyRepo, StockDailyRepository stockDailyRepo, StockTickRepository tickRepo, TransactionDateTimeRepository dateRepo)
 {
     this.stockMinutelyRepo = stockMinutelyRepo;
     this.stockDailyRepo    = stockDailyRepo;
     this.dateRepo          = dateRepo;
     this.tickRepo          = tickRepo;
     sqlWriter = new SqlServerWriter(ConnectionType.Server84);
     sqlReader = new SqlServerReader(ConnectionType.Local);
 }
 public StockMinuteRepository(ConnectionType type, IDataSource ds)
 {
     dateTimeRepo = new TransactionDateTimeRepository(type);
     sqlWriter    = new SqlServerWriter(type);
     sqlReader    = new SqlServerReader(type);
     redisReader  = new RedisReader();
     redisWriter  = new RedisWriter();
     dataSource   = ds;
 }
Exemple #12
0
 public ETFArbitrary(StockTickRepository stockRepo, StockDailyRepository stockDailyRepo, string code)
 {
     this.stockRepo      = stockRepo;
     this.stockDailyRepo = stockDailyRepo;
     dateRepo            = new TransactionDateTimeRepository(ConnectionType.Default);
     sqlWriter           = new SqlServerWriter(ConnectionType.Server84);
     sqlReader           = new SqlServerReader(ConnectionType.Server84);
     this.code           = code;
 }
 public BasisFrontNext(StockMinuteRepository stockMinutelyRepo, string code)
 {
     this.stockMinutelyRepo = stockMinutelyRepo;
     dateRepo  = new TransactionDateTimeRepository(ConnectionType.Default);
     sqlWriter = new SqlServerWriter(ConnectionType.Server84);
     sqlReader = new SqlServerReader(ConnectionType.Server84);
     this.code = code;
     indexCode = code == "IF" ? "000300.SH" : "000905.SH";
 }
Exemple #14
0
        public DataTable GetFromSpecializedSQLServer(string code, DateTime date, ConnectionType type)
        {
            var sqlReader = new SqlServerReader(type);
            var sqlStr    = string.Format(@"SELECT [stkcd],[tdatetime],[cp],[S1],[S2],[S3],[S4],[S5],[B1],[B2],[B3],[B4],[B5],[SV1],[SV2],[SV3],[SV4],[SV5],[BV1],[BV2],[BV3],[BV4],[BV5],[ts],[tt],[HighLimit],[LowLimit]
  FROM [StockTickTransaction{0}].[dbo].[{1}]",
                                          date.ToString("yyyy"), date.ToString("yyyy-MM-dd"));

            return(sqlReader.GetDataTable(sqlStr));
        }
 public pairtradingDaily(StockDailyRepository stockDailyRepo, string code1, string code2)
 {
     this.stockDailyRepo = stockDailyRepo;
     dateRepo            = new TransactionDateTimeRepository(ConnectionType.Default);
     this.code1          = code1;
     this.code2          = code2;
     sqlWriter           = new SqlServerWriter(ConnectionType.Server84);
     sqlReader           = new SqlServerReader(ConnectionType.Local);
 }
 public InfluxdbRecord(StockMinuteRepository stockMinutelyRepo, StockDailyRepository stockDailyRepo, TransactionDateTimeRepository dateRepo, StockInfoRepository stockInfoRepo)
 {
     this.stockMinutelyRepo = stockMinutelyRepo;
     this.stockDailyRepo    = stockDailyRepo;
     this.dateRepo          = dateRepo;
     this.stockInfoRepo     = stockInfoRepo;
     this.sqlReaderLocal    = new SqlServerReader(ConnectionType.Local);
     this.sqlReaderSource   = new SqlServerReader(ConnectionType.Local);
     this.sqlWriter         = new SqlServerWriter(ConnectionType.Local);
 }
 public CallDeltaHedge(StockTickRepository stockRepo, StockDailyRepository stockDailyRepo, string code, int duration)
 {
     this.stockRepo      = stockRepo;
     this.stockDailyRepo = stockDailyRepo;
     dateRepo            = new TransactionDateTimeRepository(ConnectionType.Default);
     sqlWriter           = new SqlServerWriter(ConnectionType.Server84);
     sqlReader           = new SqlServerReader(ConnectionType.Server84);
     this.code           = code;
     this.duration       = duration;
 }
 public Impv(OptionInfoRepository infoRepo, StockOptionTickRepository optionRepo, StockTickRepository stockRepo, double rate = 0.04)
 {
     this.infoRepo   = infoRepo;
     this.optionRepo = optionRepo;
     this.stockRepo  = stockRepo;
     this.rate       = rate;
     dateRepo        = new TransactionDateTimeRepository(ConnectionType.Default);
     sqlWriter       = new SqlServerWriter(ConnectionType.Server84);
     sqlReader       = new SqlServerReader(ConnectionType.Server84);
 }
 //构造函数
 public priceCeilingMoving2(StockMinuteRepository stockMinutelyRepo, StockDailyRepository stockDailyRepo, StockTickRepository stockTickRepo, StockInfoRepository stockInfoRepo)
 {
     this.stockMinutelyRepo = stockMinutelyRepo;
     this.stockDailyRepo    = stockDailyRepo;
     this.stockTickRepo     = stockTickRepo;
     dateRepo           = new TransactionDateTimeRepository(ConnectionType.Default);
     sqlWriter          = new SqlServerWriter(ConnectionType.Server84);
     sqlReader          = new SqlServerReader(ConnectionType.Local);
     this.windReader    = new WindReader();
     this.stockInfoRepo = stockInfoRepo;
 }
 public pairtradingDaily3(StockDailyRepository stockDailyRepo, string stockBoard, DateTime startTime, DateTime endTime)
 {
     this.stockDailyRepo = stockDailyRepo;
     dateRepo            = new TransactionDateTimeRepository(ConnectionType.Default);
     sqlWriter           = new SqlServerWriter(ConnectionType.Server84);
     sqlReader           = new SqlServerReader(ConnectionType.Local);
     this.stockBoard     = stockBoard;
     this.startTime      = startTime;
     this.endTime        = endTime;
     this.tradedays      = dateRepo.GetStockTransactionDate(startTime, endTime);
 }
 public TDstrategy(StockMinuteRepository stockMinutelyRepo, StockDailyRepository stockDailyRepo, string code)
 {
     this.stockMinutelyRepo = stockMinutelyRepo;
     this.stockDailyRepo    = stockDailyRepo;
     dateRepo  = new TransactionDateTimeRepository(ConnectionType.Default);
     this.code = code;
     sqlWriter = new SqlServerWriter(ConnectionType.Server84);
     sqlReader = new SqlServerReader(ConnectionType.Local);
     CreateDBOrTableIfNecessary(databaseName, tableName);
     CreateDBOrTableIfNecessary2(databaseName, tableName2);
 }
 public StockMinuteRepository(QuantitativeAnalysis.DataAccess.Infrastructure.ConnectionType type, IDataSource ds, bool redis = false)
 {
     dateTimeRepo = new TransactionDateTimeRepository(type);
     sqlWriter    = new SqlServerWriter(type);
     sqlReader    = new SqlServerReader(type);
     sqlReader170 = new SqlServerReader(Infrastructure.ConnectionType.Server170);
     dataSource   = ds;
     this.redis   = redis;
     if (redis == true)
     {
         redisReader = new RedisReader();
         redisWriter = new RedisWriter();
     }
 }
 public DualTrust(StockMinuteRepository stockMinutelyRepo, StockDailyRepository stockDailyRepo, string code, string underlyingCode)
 {
     this.stockMinutelyRepo = stockMinutelyRepo;
     this.stockDailyRepo    = stockDailyRepo;
     dateRepo            = new TransactionDateTimeRepository(ConnectionType.Default);
     this.code           = code;
     this.underlyingCode = underlyingCode;
     sqlWriter           = new SqlServerWriter(ConnectionType.Server84);
     sqlReader           = new SqlServerReader(ConnectionType.Local);
     if (code == "IF.CFE")
     {
         multiplicator = 300;
     }
 }
        public trendT0(StockMinuteRepository stockMinutelyRepo, StockDailyRepository stockDailyRepo, string stockBoard, DateTime startDate, DateTime endDate)
        {
            this.stockDailyRepo    = stockDailyRepo;
            this.stockMinutelyRepo = stockMinutelyRepo;
            dateRepo        = new TransactionDateTimeRepository(ConnectionType.Default);
            sqlWriter       = new SqlServerWriter(ConnectionType.Server84);
            sqlReader       = new SqlServerReader(ConnectionType.Local);
            this.stockBoard = stockBoard;
            this.startDate  = startDate;
            this.endDate    = endDate;
            this.tradedays  = dateRepo.GetStockTransactionDate(startDate, endDate);
            var list = searchAllStocks(stockBoard, startDate, endDate);

            list = new List <stockInfo>();
            stockInfo stock = new stockInfo();

            stock.code      = "IF.CFE";
            stock.startDate = startDate;
            stock.endDate   = endDate;
            list.Add(stock);
            getAllStocks(list);
            computeOnAllStocks(list);
        }
 public OptionInfoRepository(ConnectionType type)
 {
     sqlWriter = new SqlServerWriter(type);
     sqlReader = new SqlServerReader(type);
     dateRepo  = new TransactionDateTimeRepository(type);
 }
Exemple #26
0
 public DefaultStockTickDataSource(ConnectionType type)
 {
     sqlReader = new SqlServerReader(type);
 }
 public StockOptionInformationRepository(ConnectionType type)
 {
     sqlReader = new SqlServerReader(type);
     sqlWriter = new SqlServerWriter(type);
 }
Exemple #28
0
        static void Main(string[] args)
        {
            var connectionString = args[0];


            var logger = new ConsoleLogger();

            using (var tfs = new ThreadsFrames())
            {
                //var sf = new ConsoleCollectionSaverFactory(
                //    );

                var ftn = new FullTableName("_ss");

                var tfnc = new TargetFileNameController(
                    1,
                    @"_bbin",
                    500
                    );

                var sf = new SqlServerCollectionSaverFactory(
                    connectionString,
                    ftn,
                    tfnc
                    );
                sf.PrepareDatabase();

                var r = new SqlServerReader(
                    connectionString,
                    ftn,
                    tfnc
                    );

                using (var pq = new PublishQueue(
                           sf,
                           logger
                           ))
                {
                    var p = new Publisher(
                        pq,
                        tfs
                        );

                    var iec = new Common.IEC(tfs, p, r);

                    iec.Publisher.PublishedEvent +=
                        (
                            collections,
                            count
                        ) =>
                    {
                        var read = iec.Reader.ReadBetween(
                            new DateTime(2000, 1, 1),
                            new DateTime(2030, 1, 1)
                            );

                        Console.WriteLine(read.Last().Body);
                    };

                    ProcessMutable(iec);
                    //ProcessImmutable(iec);
                }
            }

            Console.WriteLine("Finished!");
        }