Example #1
0
        public SimulationDataProvider(string name, int id) : base()
        {
            this.Simulator        = new Simulator();
            this.Simulator.Error += (e) =>
            {
                if (this.Error != null)
                {
                    this.Error(new ProviderErrorEventArgs(new ProviderError(DateTime.Now, this, -1, -1, e.Exception.ToString())));
                }
            };
            this.Simulator.NewObject     += new SeriesObjectEventHandler(this.HandleNewObject);
            this.Simulator.LeaveInterval += (e) =>
            {
                this.iSFyRrCNfO.Clear();
            };

            this.IsConnected = false;
            this.Status      = ProviderStatus.Unknown;
            this.BarFactory  = new BarFactory(false);
            this.z1tyr7wr0l  = new Hashtable();
            this.iSFyRrCNfO  = new Dictionary <long, int>();
            this.Il6yEpdoR8  = new SortedList <DateTime, SimpleDataObject>();
            ProviderManager.Add(this);
            ProviderManager.MarketDataSimulator = this;
        }
Example #2
0
 public GMRealTimeProvider()
 {
     this.barItems = new BarFactoryItemList();
     this.barItems.Add(new BarFactoryItem(BarType.Time, 60, true));
     this.BarFactory = new BarFactory(false);
     ProviderManager.Add(this);
 }
Example #3
0
        public GSFIX()
        {
            publicKey     = "GWGSFIX";
            account       = "";
            creditAccount = "";

            // defaults
            base.DataDictionary = string.Format(@"{0}\FIX42_GS.xml", Framework.Installation.FIXDir.FullName);
            base.FileStorePath  = string.Format(@"{0}", Framework.Installation.LogDir.FullName);
            base.FileLogPath    = string.Format(@"{0}", Framework.Installation.LogDir.FullName);

            // price
            //base.priceSenderCompID = "tester";
            //base.priceTargetCompID = "TT_PRICES";
            //base.priceSocketConnectHost = "localhost";
            //base.priceSocketConnectPort = 10502;
            base.PriceFileStorePath = string.Format(@"{0}", Framework.Installation.LogDir.FullName);

            // order
            //base.orderSenderCompID = "tester";
            //base.orderTargetCompID = "TT_ORDER";
            //base.orderSocketConnectHost = "localhost";
            //base.orderSocketConnectPort = 10501;
            base.OrderFileStorePath = string.Format(@"{0}", Framework.Installation.LogDir.FullName);


            ProviderManager.Add(this);
        }
Example #4
0
 public QUIKFIX()
 {
     he1DlExnKSyvVxIfFh.qrl8YBDzYVm38();
     // ISSUE: explicit constructor call
     base.\u002Ector();
     this.FileLogPath                 = Framework.Installation.LogDir.FullName;
     this.FileLogBackupPath           = Framework.Installation.LogDir.FullName;
     this.PersistMessages             = false;
     this.FileStorePath               = Framework.Installation.LogDir.FullName;
     this.StartTime                   = TimeSpan.Parse(nvcneRd3YWS84l4984.Ey6KSwFglw(0));
     this.EndTime                     = TimeSpan.Parse(nvcneRd3YWS84l4984.Ey6KSwFglw(20));
     this.SendRedundantResendRequests = false;
     this.ResetOnLogout               = false;
     this.ResetOnDisconnect           = false;
     this.RefreshOnLogon              = false;
     this.DataDictionary              = string.Format(nvcneRd3YWS84l4984.Ey6KSwFglw(40), (object)Framework.Installation.FIXDir.FullName);
     this.CheckLatency                = true;
     this.MaxLatency                  = TimeSpan.Parse(nvcneRd3YWS84l4984.Ey6KSwFglw(80));
     this.ReconnectInterval           = TimeSpan.Parse(nvcneRd3YWS84l4984.Ey6KSwFglw(100));
     this.HeartBtInt                  = TimeSpan.Parse(nvcneRd3YWS84l4984.Ey6KSwFglw(120));
     this.SocketConnectHost           = nvcneRd3YWS84l4984.Ey6KSwFglw(140);
     this.SocketConnectPort           = 0U;
     this.SenderCompID                = string.Empty;
     this.TargetCompID                = string.Empty;
     this.DefaultAccount              = string.Empty;
     this.DefaultClientID             = string.Empty;
     this.MarketDepth                 = 0;
     ProviderManager.Add((IProvider)this);
 }
Example #5
0
 public GoogleFinance()
 {
     this.pxqdEt2GB = false;
     this.K4r2jjlJs = new Dictionary <string, WebRequest>();
     this.YZKOeBcIM = new ListDictionary();
     ProviderManager.Add((IProvider)this);
 }
Example #6
0
 public YahooHistoryDownloader()
 {
     hrYGpFbpvD3gYMJXML.N36Q1VPziPqoI();
     // ISSUE: explicit constructor call
     base.\u002Ector();
     this.K1McepZXI = false;
     this.EjDBtJJBo = new Dictionary <string, WebRequest>();
     this.FexSQYEw9 = new ListDictionary();
     this.YGOxAtD62 = true;
     ProviderManager.Add((IProvider)this);
 }
Example #7
0
        public QBProvider()
        {
            timerConnect.Elapsed  += new System.Timers.ElapsedEventHandler(timerConnect_Elapsed);
            timerAccount.Elapsed  += new System.Timers.ElapsedEventHandler(timerAccount_Elapsed);
            timerPonstion.Elapsed += new System.Timers.ElapsedEventHandler(timerPonstion_Elapsed);

            InitCallbacks();
            InitSettings();

            BarFactory = new BarFactory();
            status     = ProviderStatus.Unknown;
            ProviderManager.Add(this);
        }
Example #8
0
        public IQFeedProvider()
        {
            iqf = new IQFeed();
            //iqf.IQ32DLLPath = "H:\\Program Files\\trading\\DTN\\DTN.IQ\\";
            iqf.Messages += new MessageEventHandler(EmitMessage);

            iqfl2 = new IQFeedLevelII();

            BarFactory         = new BarFactory();
            htL1WatchedSymbols = new Hashtable();
            htL2WatchedSymbols = new Hashtable();

            ProviderManager.Add(this);
        }
Example #9
0
 public SimulationDataProvider(string name, int id)
 {
     this.simulator                = new Simulator();
     this.simulator.Error         += new ExceptionEventHandler(this.OnError);
     this.simulator.NewObject     += new SeriesObjectEventHandler(this.OnNewObject);
     this.simulator.LeaveInterval += new IntervalEventHandler(this.OnLeaveInterval);
     this.isConnected              = false;
     this.status      = ProviderStatus.Unknown;
     this.BarFactory  = new BarFactory(false);
     this.seriesTable = new Hashtable();
     this.slices      = new Dictionary <long, int>();
     ProviderManager.Add(this);
     ProviderManager.MarketDataSimulator = this;
 }
 public SimulationExecutionProvider()
 {
     this.Status             = ProviderStatus.Unknown;
     this.MyIPdEI7fi         = new Hashtable();
     this.FillOnQuote        = true;
     this.FillOnTrade        = true;
     this.FillOnBar          = true;
     this.TriggerOnQuote     = true;
     this.TriggerOnTrade     = true;
     this.TriggerOnBar       = true;
     this.PartialFills       = true;
     this.CommissionProvider = (ICommissionProvider) new CommissionProvider();
     this.SlippageProvider   = (ISlippageProvider) new SlippageProvider();
     this.BarFilter          = new BarFilter();
     ProviderManager.Add(this);
     ProviderManager.ExecutionSimulator = this;
 }
Example #11
0
        public void AddingExistProvider()
        {
            var provider = new Provider()
            {
                Name        = "Carlos",
                LastName    = "Mambrake",
                PhoneNumber = "52948962",
                Address     = "Guantanamo,Cuba"
            };


            //Act

            var providerManager = new ProviderManager(dataServiceMock.Object);

            Assert.ThrowsException <Exception>(() => providerManager.Add(provider));
            dataServiceMock.Verify(m => m.Insert(provider), Times.Never);
        }
Example #12
0
 public GSFIXProvider()
 {
     try
     {
         this.trador = new FIXTrade();
         this.trador.OnConnection         += new EventHandler(OnConnection);
         this.trador.OnDisconnection      += new EventHandler(OnDisconnection);
         this.trador.ExecutionReport      += new ExecutionReportEventHandler(OnExecutionReport);
         this.trador.OrderCancelReject    += new OrderCancelRejectEventHandler(OnOrderCancelReject);
         this.trador.FundStatusReport     += new FundStatusReportEventHandler(OnFundStatusReport);
         this.trador.PositionStatusReport += new PositionStatusReportEventHandler(OnPositionStatusReport);
         autoResetEvent = new AutoResetEvent(false);
     }
     catch (Exception ex)
     {
         EmitError(-1, -1, ex.Message);
     }
     ProviderManager.Add(this);
 }
Example #13
0
 public void LoadPlugin(PluginInfo plugin)
 {
     try
     {
         object obj = plugin.Load();
         if (plugin.PluginType != PluginType.UserProvider)
         {
             return;
         }
         FieldInfo field = typeof(UserProvider).GetField("provider", BindingFlags.Instance | BindingFlags.NonPublic);
         if (field == null)
         {
             return;
         }
         ProviderManager.Add((IProvider)field.GetValue(obj));
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
     }
 }
Example #14
0
        public void AddingNewProvider()
        {
            var provider = new Provider()
            {
                Name        = "Michel",
                LastName    = "Piti",
                PhoneNumber = "52529187",
                Address     = "La Habana, Cuba",
            };

            //Setup

            dataServiceMock.Setup(m => m.Insert <Provider>(provider))
            .Returns(new Provider()
            {
                PersonId    = 4,
                Name        = provider.Name,
                LastName    = provider.LastName,
                PhoneNumber = provider.PhoneNumber,
                Address     = provider.Address
            })
            .Verifiable();


            //Act

            var providerManager  = new ProviderManager(dataServiceMock.Object);
            var providerExpected = providerManager.Add(provider);

            //Assert

            dataServiceMock.Verify();
            Assert.AreEqual(4, providerExpected.PersonId);
            Assert.AreEqual(providerExpected.Name, provider.Name);
            Assert.AreEqual(4, providers.Count);
        }
 public DZHHistoricalProvider()
 {
     ProviderManager.Add(this);
 }
Example #16
0
 public DZHMarketProvider()
 {
     this.BarFactory = new DZHBarFactory(true, this);
     ProviderManager.Add(this);
 }
 public SimulationExecutionProvider()
 {
     ProviderManager.Add(this);
     ProviderManager.ExecutionSimulator = this;
 }
Example #18
0
 public GMQueryDataProvider()
 {
     _md = GMSDK.MdApi.Instance;
     ProviderManager.Add(this);
 }
Example #19
0
 public DZHInstrumentProvider()
 {
     ProviderManager.Add(this);
 }
 public TDXTradeProvider()
 {
     this.trader = TDXTrader.Instance;
     ProviderManager.Add(this);
 }
Example #21
0
        /// <summary>
        /// 初始化业务逻辑层
        /// </summary>
        ///
        public static void Init()
        {
            //TODO:错误处理,不能因为异常导致程序启动失败

            //注册应用程序
            AppManager.RegisterApp(new BasicApp());

            #region 注册AppHandler

            AppHandlerManager.RegisterAppHandler(new DownloadHandler());
            AppHandlerManager.RegisterAppHandler(new DeleteTempFileHandler());
            AppHandlerManager.RegisterAppHandler(new OutputValidateCodeHandler());
            AppHandlerManager.RegisterAppHandler(new ExecuteJobHandler());
            AppHandlerManager.RegisterAppHandler(new StepByStepTaskHandler());
            AppHandlerManager.RegisterAppHandler(new UploadTempFileHandler());

            AppHandlerManager.RegisterAppHandler(new RegValidateHandler());
            AppHandlerManager.RegisterAppHandler(new ChatMessageHandler());
            AppHandlerManager.RegisterAppHandler(new AvatarHandler());
            AppHandlerManager.RegisterAppHandler(new TempDataHandler());
#if !Passport
            AppHandlerManager.RegisterAppHandler(new Js_EmoticonHandler());
            AppHandlerManager.RegisterAppHandler(new NotifyHandler());
            AppHandlerManager.RegisterAppHandler(new DoingHandler());
            AppHandlerManager.RegisterAppHandler(new ChangeSkinHandler());
            AppHandlerManager.RegisterAppHandler(new OnlineInfoHandler());
            AppHandlerManager.RegisterAppHandler(new PostAuthorInfoHandler());
            //AppHandlerManager.RegisterAppHandler(new AttachmentHandler());
#endif

            #endregion

            #region 注册积分动作规则

            PointActionManager.RegisterPointActionType(UserPointAction.Instance);
            PointActionManager.RegisterPointActionType(InvitePointAction.Instance);
#if !Passport
            PointActionManager.RegisterPointActionType(SharePointAction.Instance);
            PointActionManager.RegisterPointActionType(BlogPointAction.Instance);
            //PointActionManager.RegisterPointActionType(PointShowPointAction.Instance);
            PointActionManager.RegisterPointActionType(CommentPointAction.Instance);
            PointActionManager.RegisterPointActionType(AlbumPointAction.Instance);
            PointActionManager.RegisterPointActionType(DoingPointAction.Instance);
            PointActionManager.RegisterPointActionType(ForumPointAction.Instance);
#endif
            #endregion

            #region 注册验证码样式

            ValidateCodeManager.RegisterValidateCodeType(new ValidateCode_Style1());
            ValidateCodeManager.RegisterValidateCodeType(new ValidateCode_Style2());
            ValidateCodeManager.RegisterValidateCodeType(new ValidateCode_Style3());
            ValidateCodeManager.RegisterValidateCodeType(new ValidateCode_Style4());
            ValidateCodeManager.RegisterValidateCodeType(new ValidateCode_Style5());
            ValidateCodeManager.RegisterValidateCodeType(new ValidateCode_Style6());
            ValidateCodeManager.RegisterValidateCodeType(new ValidateCode_Style7());
            ValidateCodeManager.RegisterValidateCodeType(new ValidateCode_Style8());
            ValidateCodeManager.RegisterValidateCodeType(new ValidateCode_Style9());
            ValidateCodeManager.RegisterValidateCodeType(new ValidateCode_Style10());
            ValidateCodeManager.RegisterValidateCodeType(new ValidateCode_Style11());
            ValidateCodeManager.RegisterValidateCodeType(new ValidateCode_Style12());

            #endregion

            #region 注册验证码动作

            ValidateCodeManager.RegisterValidateCodeAction(new ValidateCodeAction("注册", "Register", false));
            ValidateCodeManager.RegisterValidateCodeAction(new ValidateCodeAction("登录", "Login", false));
            ValidateCodeManager.RegisterValidateCodeAction(new ValidateCodeAction("管理员登陆", "ManageLogin", false));
            ValidateCodeManager.RegisterValidateCodeAction(new ValidateCodeAction("找回密码", "recoverpassword", false));

            ValidateCodeManager.RegisterValidateCodeAction(new ValidateCodeAction("发表分享", "CreateShare", true));
            //ValidateCodeManager.RegisterValidateCodeAction(new ValidateCodeAction("发表收藏", "CreateCollection", true));
            ValidateCodeManager.RegisterValidateCodeAction(new ValidateCodeAction("发表日志", "CreateBlogArticle", true));
            //ValidateCodeManager.RegisterValidateCodeAction(new ValidateCodeAction("发表记录", "CreateDoing", true));
            ValidateCodeManager.RegisterValidateCodeAction(new ValidateCodeAction("发表评论", "CreateComment", true));

            //论坛---
            ValidateCodeManager.RegisterValidateCodeAction(new ValidateCodeAction("发表主题", "CreateTopic", true));
            ValidateCodeManager.RegisterValidateCodeAction(new ValidateCodeAction("回复主题", "ReplyTopic", true));
            ValidateCodeManager.RegisterValidateCodeAction(new ValidateCodeAction("参与投票", "Vote", true));
            ValidateCodeManager.RegisterValidateCodeAction(new ValidateCodeAction("登陆带密码版块", "SignInForum", true));
            ValidateCodeManager.RegisterValidateCodeAction(new ValidateCodeAction("加好友", "AddFriend", true));
            ValidateCodeManager.RegisterValidateCodeAction(new ValidateCodeAction("对话", "SendMessage", true));
            ValidateCodeManager.RegisterValidateCodeAction(new ValidateCodeAction("打招呼", "Hail", true));
            #endregion

            #region 注册XCmd

            XCmdManager.RegisterXCmd(new DeleteFileCmd());
            XCmdManager.RegisterXCmd(new ResetVarsCacheCmd());
            XCmdManager.RegisterXCmd(new ResetUserCacheCmd());

            XCmdManager.RegisterXCmd(new RecodeTodayPostsCmd());

#if !Passport
            XCmdManager.RegisterXCmd(new ResetAuthUserCacheCmd());
            XCmdManager.RegisterXCmd(new ResetAlbumCacheCmd());
            XCmdManager.RegisterXCmd(new ResetDenouncingCacheCmd());
            XCmdManager.RegisterXCmd(new ResetFeedCommentInfoCmd());
#endif

            #endregion

#if !Passport
            #region 注册 PermissionSetWithNode

            SettingManager.RegisterPermissionWithNode(new ForumPermissionSetNode().TypeName, new ForumPermissionSet());
            SettingManager.RegisterPermissionWithNode(new ManageForumPermissionSetNode().TypeName, new ManageForumPermissionSet());

            #endregion

            #region 注册UploadAction

            FileManager.RegisterUploadAction(new UploadAttachmentAction());
            FileManager.RegisterUploadAction(new UploadAlbumPhotoAction());
            FileManager.RegisterUploadAction(new UploadDiskFileAction());

            #endregion

            #region 注册 IShareProvider

            ProviderManager.Add <IShareProvider>(new ShareBlogArticleProvider());
            ProviderManager.Add <IShareProvider>(new ShareAlbumProvider());
            ProviderManager.Add <IShareProvider>(new SharePhotoProvider());
            ProviderManager.Add <IShareProvider>(new ShareUserProvider());
            ProviderManager.Add <IShareProvider>(new ShareThreadProvider());

            #endregion
#endif

            #region 取数据库时间和时区作为当前时间和时区,避免web和数据库时间不同步

            SetTimeAsDatabase();

            #endregion

            #region 注册计划任务

            JobManager.RegisterJob(new BeforeRequestInDay0AM());
            JobManager.RegisterJob(new BeforeRequestIn5M());



            JobManager.RegisterJob(new AfterRequestIn5M());
            JobManager.RegisterJob(new AfterRequestIn3H());
            JobManager.RegisterJob(new AfterRequestInDay3AM());

            JobManager.RegisterJob(new ClearNotifyJob());
            JobManager.RegisterJob(new ClearChatMessageJob());
            JobManager.RegisterJob(new ClearPointLogJob());

#if !Passport
            JobManager.RegisterJob(new UpdateThreadViewsJob());
            JobManager.RegisterJob(new SaveOnlineUserJob());

            JobManager.RegisterJob(new DeleteFeedJob());
            JobManager.RegisterJob(new DeletePropLogJob());
            JobManager.RegisterJob(new DeleteOperationLogJob());

            JobManager.RegisterJob(new BaiduPageOpJop());
#endif
            //在所有计划任务注册完之后  启动线程
            JobManager.StartJobThread();

            #endregion

            #region 初始化PASSPORT指令引擎

            if (AllSettings.Current.PassportServerSettings.EnablePassportService)
            {
                PassportBO.StartInstructEngine();
            }

            #endregion
        }