The Generator
Inheritance: System.Windows.Forms.Form
示例#1
0
        /// <summary>
        ///  Sets the data starting parameters.
        /// </summary>
        void DataHorizon()
        {
            DateTime dtStart = new DateTime(Configs.StartYear, Configs.StartMonth, Configs.StartDay);
            DateTime dtEnd   = new DateTime(Configs.EndYear, Configs.EndMonth, Configs.EndDay);

            Data_Horizon horizon = new Data_Horizon(Configs.MaxBars, dtStart, dtEnd, Configs.UseStartDate, Configs.UseEndDate);

            horizon.ShowDialog();

            if (horizon.DialogResult == DialogResult.OK)
            {   // Applying the new settings
                Configs.MaxBars      = horizon.MaxBars;
                Configs.StartYear    = horizon.StartDate.Year;
                Configs.StartMonth   = horizon.StartDate.Month;
                Configs.StartDay     = horizon.StartDate.Day;
                Configs.EndYear      = horizon.EndDate.Year;
                Configs.EndMonth     = horizon.EndDate.Month;
                Configs.EndDay       = horizon.EndDate.Day;
                Configs.UseStartDate = horizon.UseStartDate;
                Configs.UseEndDate   = horizon.UseEndDate;

                if (LoadInstrument(false) == 0)
                {
                    Calculate(true);
                    PrepareScannerCompactMode();
                }
            }

            return;
        }
        /// <summary>
        ///  Sets the data starting parameters.
        /// </summary>
        void DataHorizon()
        {
            DateTime dtStart = new DateTime(Configs.StartYear, Configs.StartMonth, Configs.StartDay);
            DateTime dtEnd   = new DateTime(Configs.EndYear,   Configs.EndMonth,   Configs.EndDay);

            Data_Horizon horizon = new Data_Horizon(Configs.MaxBars, dtStart, dtEnd, Configs.UseStartDate, Configs.UseEndDate);
            horizon.ShowDialog();

            if (horizon.DialogResult == DialogResult.OK)
            {   // Applying the new settings
                Configs.MaxBars      = horizon.MaxBars;
                Configs.StartYear    = horizon.StartDate.Year;
                Configs.StartMonth   = horizon.StartDate.Month;
                Configs.StartDay     = horizon.StartDate.Day;
                Configs.EndYear      = horizon.EndDate.Year;
                Configs.EndMonth     = horizon.EndDate.Month;
                Configs.EndDay       = horizon.EndDate.Day;
                Configs.UseStartDate = horizon.UseStartDate;
                Configs.UseEndDate   = horizon.UseEndDate;

                if (LoadInstrument(false) == 0)
                {
                    Calculate(true);
                    PrepareScannerCompactMode();
                }
            }

            return;
        }