void _sessionManager_SourcesUpdateEvent(IAnalyzerSessionManager parameter1)
        {
            //lock (this)
            //{
            //    if (_sessionManager.OrderExecutionSources.Length > 0
            //        && _sessionManager.DataProviderSources.Length > 0)
            //    {
            //        SessionInfo[] sessionInfos = new SessionInfo[] { };
            //        while (sessionInfos.Length == 0)
            //        {
            //            Thread.Sleep(1000);
            //            sessionInfos = _sessionManager.GetSourceSessions(_sessionManager.DataProviderSources[0], false);
            //        }

            //        _sessionManager.CreateSession(AnalyzerSessionTypeEnum.LiveTrading,
            //            _sessionManager.DataProviderSources[0], _sessionManager.OrderExecutionSources[0], sessionInfos[0]);
            //    }
            //}
        }
Example #2
0
        void _sessionManager_SourcesUpdateEvent(IAnalyzerSessionManager parameter1)
        {
            //lock (this)
            //{
            //    if (_sessionManager.OrderExecutionSources.Length > 0
            //        && _sessionManager.DataProviderSources.Length > 0)
            //    {
            //        SessionInfo[] sessionInfos = new SessionInfo[] { };
            //        while (sessionInfos.Length == 0)
            //        {
            //            Thread.Sleep(1000);
            //            sessionInfos = _sessionManager.GetSourceSessions(_sessionManager.DataProviderSources[0], false);
            //        }

            //        _sessionManager.CreateSession(AnalyzerSessionTypeEnum.LiveTrading,
            //            _sessionManager.DataProviderSources[0], _sessionManager.OrderExecutionSources[0], sessionInfos[0]);
            //    }
            //}
        }
 /// <summary>
 ///
 /// </summary>
 public Analyzer(IAnalyzerSessionManager sessionManager, string name)
 {
     _sessionManager = sessionManager;
     this.name       = name;
 }
Example #4
0
 void _sessionManager_SessionsUpdateEvent(IAnalyzerSessionManager parameter1)
 {
 }
Example #5
0
 /// <summary>
 ///
 /// </summary>
 public ProfessionalAnalyzer(IAnalyzerSessionManager sessionManager, string name)
     : base(sessionManager, name)
 {
     _sessionManager = sessionManager;
     //_sessionManager.SourcesUpdateEvent += new GeneralHelper.GenericDelegate<IAnalyzerSessionManager>(_sessionManager_SourcesUpdateEvent);
 }
 /// <summary>
 /// 
 /// </summary>
 public ProfessionalAnalyzer(IAnalyzerSessionManager sessionManager, string name)
     : base(sessionManager, name)
 {
     _sessionManager = sessionManager;
     //_sessionManager.SourcesUpdateEvent += new GeneralHelper.GenericDelegate<IAnalyzerSessionManager>(_sessionManager_SourcesUpdateEvent);
 }
 void _sessionManager_SessionsUpdateEvent(IAnalyzerSessionManager parameter1)
 {
 }
        /// <summary>
        /// 
        /// </summary>
        public FxAnalyzerControl(ProfessionalAnalyzer expert)
        {
            InitializeComponent();

            tradeAnalyzer = expert;
            tradeAnalyzer.SessionManager.SessionsUpdateEvent += new GeneralHelper.GenericDelegate<IAnalyzerSessionManager>(SessionManager_SessionUpdateEvent);

            //Adjust Listview column width
            priceListView_ColumnWidthChanged();

            DataService.priceList = priceListView;
            DataService.ImageList = imageList1;

               //��������Դ
            _host = tradeAnalyzer.SessionManager;

            _sessions = null;
            _sessions = FxpaSource.SessionList.ToArray();

            int i;

            for (i = 0; i < _sessions.Length; i++)
            {
                string symbol = AppUtil.GetSymbolChinese(_sessions[i].Symbol);
                if (symbol != "")
                {
                  ListViewItem   p = new ListViewItem(new string[] { AppUtil.GetSymbolChinese(_sessions[i].Symbol), "", "", "" });
                    priceListView.Items.Add(p);
                }
            }

            //priceListView.Items.AddRange(p);

            // Comment by Harry
            //���������Զ�Adjust ��ͷ��С
            //AutoResizeColumnWidth(priceListView);

            //
            DateTime now = DateTime.Now;
            //this.titleStrip1.HeaderText.Text = " " + now.ToString("MM dd, yyyy  " + AppConst.Days[Convert.ToInt16(now.DayOfWeek)]);
            //this.titleStrip1.HeaderText.Font = new Font(this.titleStrip1.HeaderText.Font, FontStyle.Bold);
            //this.titleStrip1.HeaderText.Margin = new Padding(10, 0, 0, 0);
            //this.titleStrip1.HeaderText.ForeColor = Color.FromArgb(91, 89, 91);
            timeLabel.Text =now.ToString("MM'��'dd' day ' " + AppConst.Days[Convert.ToInt16(now.DayOfWeek)]);
            //this.label1.Margin = new Padding(10, 0, 0, 0);
            //this.label1.ForeColor = Color.FromArgb(91, 89, 91);
            timeLabel.Refresh();

             AnalyzerSession session;
            foreach (SessionInfo sin in FxpaSource.AvailableSessionList)
            {
                    aliveSessions.Add(sin.Symbol);
                    session = _host.CreateSimulationSession(sin);
                    break;
            }

            //AppContext.SignalHandler.PriceListView = priceListView;
            //AppContext.SignalHandler.AnalyzerControl = this;
            //AppContext.SignalListHandler.PriceListView = priceListView;
              //  AppContext.TimeCheckHandler.PriceListView = priceListView;
            AppContext.PriceListView = priceListView;
            AppContext.TradeAnalyzerControl = this;
        }
 void SessionManager_SessionUpdateEvent(IAnalyzerSessionManager sessionManager)
 {
     this.BeginInvoke(new GeneralHelper.DefaultDelegate(UpdateUI));
 }
 /// <summary>
 /// 
 /// </summary>
 public Analyzer(IAnalyzerSessionManager sessionManager, string name)
 {
     _sessionManager = sessionManager;
     this.name = name;
 }
Example #11
0
 void SessionManager_SessionUpdateEvent(IAnalyzerSessionManager sessionManager)
 {
     this.BeginInvoke(new GeneralHelper.DefaultDelegate(UpdateUI));
 }
Example #12
0
        /// <summary>
        ///
        /// </summary>
        public FxAnalyzerControl(ProfessionalAnalyzer expert)
        {
            InitializeComponent();

            tradeAnalyzer = expert;
            tradeAnalyzer.SessionManager.SessionsUpdateEvent += new GeneralHelper.GenericDelegate <IAnalyzerSessionManager>(SessionManager_SessionUpdateEvent);

            //Adjust Listview column width
            priceListView_ColumnWidthChanged();

            DataService.priceList = priceListView;
            DataService.ImageList = imageList1;

            //设置数据源
            _host = tradeAnalyzer.SessionManager;

            _sessions = null;
            _sessions = FxpaSource.SessionList.ToArray();

            int i;

            for (i = 0; i < _sessions.Length; i++)
            {
                string symbol = AppUtil.GetSymbolChinese(_sessions[i].Symbol);
                if (symbol != "")
                {
                    ListViewItem p = new ListViewItem(new string[] { AppUtil.GetSymbolChinese(_sessions[i].Symbol), "", "", "" });
                    priceListView.Items.Add(p);
                }
            }

            //priceListView.Items.AddRange(p);

            // Comment by Harry
            //根据内容自动Adjust 列头大小
            //AutoResizeColumnWidth(priceListView);

            //
            DateTime now = DateTime.Now;

            //this.titleStrip1.HeaderText.Text = " " + now.ToString("MM dd, yyyy  " + AppConst.Days[Convert.ToInt16(now.DayOfWeek)]);
            //this.titleStrip1.HeaderText.Font = new Font(this.titleStrip1.HeaderText.Font, FontStyle.Bold);
            //this.titleStrip1.HeaderText.Margin = new Padding(10, 0, 0, 0);
            //this.titleStrip1.HeaderText.ForeColor = Color.FromArgb(91, 89, 91);
            timeLabel.Text = now.ToString("MM'月'dd' day ' " + AppConst.Days[Convert.ToInt16(now.DayOfWeek)]);
            //this.label1.Margin = new Padding(10, 0, 0, 0);
            //this.label1.ForeColor = Color.FromArgb(91, 89, 91);
            timeLabel.Refresh();

            AnalyzerSession session;

            foreach (SessionInfo sin in FxpaSource.AvailableSessionList)
            {
                aliveSessions.Add(sin.Symbol);
                session = _host.CreateSimulationSession(sin);
                break;
            }

            //AppContext.SignalHandler.PriceListView = priceListView;
            //AppContext.SignalHandler.AnalyzerControl = this;
            //AppContext.SignalListHandler.PriceListView = priceListView;
            //  AppContext.TimeCheckHandler.PriceListView = priceListView;
            AppContext.PriceListView        = priceListView;
            AppContext.TradeAnalyzerControl = this;
        }