Beispiel #1
0
 public override void UnInitializeControl()
 {
     if (tradeAnalyzer != null)
     {
         tradeAnalyzer.SessionManager.SessionsUpdateEvent -= new GeneralHelper.GenericDelegate <IAnalyzerSessionManager>(SessionManager_SessionUpdateEvent);
         tradeAnalyzer = null;
     }
 }
        void SetupDefaultPlatform()
        {
            this.tabControl.SuspendLayout();
            this.tabControl.Visible = false;

            // Harry-RS
            FxpaSource fxpaSource = new FxpaSource();

            fxpaSource.SetInitialState(fxpaBaseForm.Settings);
            fxpaBaseForm.RegisterComponent(fxpaSource);

            LocalAnalyzerHost host = new LocalAnalyzerHost("Manual Trading", typeof(ProfessionalAnalyzer));

            fxpaBaseForm.RegisterComponent(host);

            //Thread.Sleep(250);

            ProfessionalAnalyzer expert = (ProfessionalAnalyzer)host.Analyzer;

            this.tabControl.ResumeLayout();
            this.tabControl.Visible = true;
        }
        /// <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;
        }
 public override void UnInitializeControl()
 {
     if (tradeAnalyzer != null)
     {
         tradeAnalyzer.SessionManager.SessionsUpdateEvent -= new GeneralHelper.GenericDelegate<IAnalyzerSessionManager>(SessionManager_SessionUpdateEvent);
         tradeAnalyzer = null;
     }
 }
Beispiel #5
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;
        }