Bar Closing Indicator
Inheritance: Indicator
示例#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";

            Bar_Opening 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;

            Bar_Closing 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;

            return;
        }
示例#2
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;
        }