예제 #1
0
        /// <summary>
        /// Generates a new strategy.
        /// </summary>
        public static void GenerateNew()
        {
            Data.Strategy = new Strategy(0, 0);

            int openSlotNum  = Data.Strategy.OpenSlot;
            int closeSlotNum = Data.Strategy.CloseSlot;

            Data.Strategy.StrategyName = "New";

            var barOpening = new Bar_Opening(SlotTypes.Open);

            barOpening.Calculate(SlotTypes.Open);
            Data.Strategy.Slot[openSlotNum].IndParam       = barOpening.IndParam;
            Data.Strategy.Slot[openSlotNum].IndicatorName  = barOpening.IndicatorName;
            Data.Strategy.Slot[openSlotNum].Component      = barOpening.Component;
            Data.Strategy.Slot[openSlotNum].SeparatedChart = barOpening.SeparatedChart;
            Data.Strategy.Slot[openSlotNum].SpecValue      = barOpening.SpecialValues;
            Data.Strategy.Slot[openSlotNum].MaxValue       = barOpening.SeparatedChartMaxValue;
            Data.Strategy.Slot[openSlotNum].MinValue       = barOpening.SeparatedChartMinValue;
            Data.Strategy.Slot[openSlotNum].IsDefined      = true;

            var barClosing = new Bar_Closing(SlotTypes.Close);

            barClosing.Calculate(SlotTypes.Close);
            Data.Strategy.Slot[closeSlotNum].IndParam       = barClosing.IndParam;
            Data.Strategy.Slot[closeSlotNum].IndicatorName  = barClosing.IndicatorName;
            Data.Strategy.Slot[closeSlotNum].Component      = barClosing.Component;
            Data.Strategy.Slot[closeSlotNum].SeparatedChart = barClosing.SeparatedChart;
            Data.Strategy.Slot[closeSlotNum].SpecValue      = barClosing.SpecialValues;
            Data.Strategy.Slot[closeSlotNum].MaxValue       = barClosing.SeparatedChartMaxValue;
            Data.Strategy.Slot[closeSlotNum].MinValue       = barClosing.SeparatedChartMinValue;
            Data.Strategy.Slot[closeSlotNum].IsDefined      = true;
        }
예제 #2
0
        /// <summary>
        /// Generates a new strategy.
        /// </summary>
        public static void GenerateNew()
        {
            Data.Strategy = new Strategy(0, 0);

            int iOpenSlotNum  = Data.Strategy.OpenSlot;
            int iCloseSlotNum = Data.Strategy.CloseSlot;

            Data.Strategy.StrategyName = "New";

            Bar_Opening barOpening = new Bar_Opening(SlotTypes.Open);
            barOpening.Calculate(SlotTypes.Open);
            Data.Strategy.Slot[iOpenSlotNum].IndParam       = barOpening.IndParam;
            Data.Strategy.Slot[iOpenSlotNum].IndicatorName  = barOpening.IndicatorName;
            Data.Strategy.Slot[iOpenSlotNum].Component      = barOpening.Component;
            Data.Strategy.Slot[iOpenSlotNum].SeparatedChart = barOpening.SeparatedChart;
            Data.Strategy.Slot[iOpenSlotNum].SpecValue      = barOpening.SpecialValues;
            Data.Strategy.Slot[iOpenSlotNum].MaxValue       = barOpening.SeparatedChartMaxValue;
            Data.Strategy.Slot[iOpenSlotNum].MinValue       = barOpening.SeparatedChartMinValue;
            Data.Strategy.Slot[iOpenSlotNum].IsDefined      = true;

            Bar_Closing barClosing = new Bar_Closing(SlotTypes.Close);
            barClosing.Calculate(SlotTypes.Close);
            Data.Strategy.Slot[iCloseSlotNum].IndParam       = barClosing.IndParam;
            Data.Strategy.Slot[iCloseSlotNum].IndicatorName  = barClosing.IndicatorName;
            Data.Strategy.Slot[iCloseSlotNum].Component      = barClosing.Component;
            Data.Strategy.Slot[iCloseSlotNum].SeparatedChart = barClosing.SeparatedChart;
            Data.Strategy.Slot[iCloseSlotNum].SpecValue      = barClosing.SpecialValues;
            Data.Strategy.Slot[iCloseSlotNum].MaxValue       = barClosing.SeparatedChartMaxValue;
            Data.Strategy.Slot[iCloseSlotNum].MinValue       = barClosing.SeparatedChartMinValue;
            Data.Strategy.Slot[iCloseSlotNum].IsDefined      = true;

            return;
        }