Example #1
0
        /// <summary>
        /// Called on every new bar of data.
        /// </summary>
        /// <param name="currentBar">The current bar of the simulation</param>
        protected override void OnBarUpdate(int currentBar)
        {
            base.OnBarUpdate(currentBar);

            Trend trend = (Trend)Dependents[0];

            if (currentBar < 2)
            {
                return;
            }

            if (Data.Close[currentBar - 2] < Data.Open[currentBar - 2] && Data.Close[currentBar - 1] < Data.Close[currentBar - 2] && Data.Open[currentBar] > (Math.Abs((Data.Close[currentBar - 1] - Data.Open[currentBar - 1]) / 2) + Data.Open[currentBar - 1]) && Data.Close[currentBar] > Data.Open[currentBar])
            {
                Found[currentBar] = true;
            }
        }
Example #2
0
        /// <summary>
        /// Called on every new bar of data.
        /// </summary>
        /// <param name="currentBar">The current bar of the simulation</param>
        protected override void OnBarUpdate(int currentBar)
        {
            base.OnBarUpdate(currentBar);

            Trend trend = (Trend)Dependents[0];

            if (currentBar < 1 || (Simulator.Config.TrendStrength > 0 && trend.DownTrend[currentBar] == true))
            {
                return;
            }

            if (Data.Open[currentBar] > Data.High[currentBar - 1] && Data.Close[currentBar - 1] > Data.Open[currentBar - 1] && Data.Close[currentBar] < Data.Open[currentBar] && Data.Close[currentBar] <= Data.Close[currentBar - 1] - (Data.Close[currentBar - 1] - Data.Open[currentBar - 1]) / 2 && Data.Close[currentBar] >= Data.Open[currentBar - 1])
            {
                Found[currentBar] = true;
            }
        }
        /// <summary>
        /// Called on every new bar of data.
        /// </summary>
        /// <param name="currentBar">The current bar of the simulation</param>
        protected override void OnBarUpdate(int currentBar)
        {
            base.OnBarUpdate(currentBar);

            Trend trend = (Trend)Dependents[0];

            if (currentBar < 1 || (Simulator.Config.TrendStrength > 0 && trend.UpTrend[currentBar] == true))
            {
                return;
            }

            if (Data.High[currentBar] > Data.Open[currentBar] && (Data.High[currentBar] - Data.Open[currentBar]) >= 2 * (Data.Open[currentBar] - Data.Close[currentBar]) && Data.Close[currentBar] < Data.Open[currentBar] && (Data.Close[currentBar] - Data.Low[currentBar]) <= 2 * Data.TickSize)
            {
                Found[currentBar] = true;
            }
        }
Example #4
0
        /// <summary>
        /// Called on every new bar of data.
        /// </summary>
        /// <param name="currentBar">The current bar of the simulation</param>
        protected override void OnBarUpdate(int currentBar)
        {
            base.OnBarUpdate(currentBar);

            Trend trend = (Trend)Dependents[0];

            if (Simulator.Config.TrendStrength > 0 && trend.UpTrend[currentBar] == true)
            {
                return;
            }

            if (Math.Abs(Data.Close[currentBar] - Data.Open[currentBar]) <= (Data.High[currentBar] - Data.Low[currentBar]) * 0.07)
            {
                Found[currentBar] = true;
            }
        }
Example #5
0
        /// <summary>
        /// Called on every new bar of data.
        /// </summary>
        /// <param name="currentBar">The current bar of the simulation</param>
        protected override void OnBarUpdate(int currentBar)
        {
            base.OnBarUpdate(currentBar);

            Trend trend = (Trend)Dependents[0];

            if (Simulator.Config.TrendStrength > 0)
            {
                if (trend.DownTrend[currentBar] == true || UtilityMethods.Max(Data.Low, currentBar, Simulator.Config.TrendStrength) != Data.High[currentBar])
                {
                    return;
                }
            }

            if (Data.Low[currentBar] < Data.Open[currentBar] - 5 * Data.TickSize && Math.Abs(Data.Open[currentBar] - Data.Close[currentBar]) < (0.10 * (Data.High[currentBar] - Data.Low[currentBar])) && (Data.High[currentBar] - Data.Close[currentBar]) < (0.25 * (Data.High[currentBar] - Data.Low[currentBar])))
            {
                Found[currentBar] = true;
            }
        }
        /// <summary>
        /// Called on every new bar of data.
        /// </summary>
        /// <param name="currentBar">The current bar of the simulation</param>
        protected override void OnBarUpdate(int currentBar)
        {
            base.OnBarUpdate(currentBar);

            Trend trend = (Trend)Dependents[0];

            if (currentBar < 2)
            {
                return;
            }

            if (Data.Close[currentBar - 2] > Data.Open[currentBar - 2] && Data.Close[currentBar - 1] > Data.Open[currentBar - 1] && Data.Close[currentBar] < Data.Open[currentBar] &&
                Data.Low[currentBar - 1] > Data.High[currentBar - 2] &&
                Data.Open[currentBar] < Data.Close[currentBar - 1] && Data.Open[currentBar] > Data.Open[currentBar - 1] &&
                Data.Close[currentBar] < Data.Open[currentBar - 1] && Data.Close[currentBar] > Data.Close[currentBar - 2])
            {
                Found[currentBar] = true;
            }
        }
        /// <summary>
        /// Called on every new bar of data.
        /// </summary>
        /// <param name="currentBar">The current bar of the simulation</param>
        protected override void OnBarUpdate(int currentBar)
        {
            base.OnBarUpdate(currentBar);

            Trend trend = (Trend)Dependents[0];

            if (currentBar < 2 || (Simulator.Config.TrendStrength > 0 && trend.DownTrend[currentBar] == true))
            {
                return;
            }

            if (Found[currentBar - 1] == false && Found[currentBar - 2] == false &&
                Data.Close[currentBar] < Data.Open[currentBar] && Data.Close[currentBar - 1] < Data.Open[currentBar - 1] && Data.Close[currentBar - 2] < Data.Open[currentBar - 2] &&
                Data.Close[currentBar] < Data.Close[currentBar - 1] && Data.Close[currentBar - 1] < Data.Close[currentBar - 2] &&
                Data.Open[currentBar] < Data.Open[currentBar - 1] && Data.Open[currentBar] > Data.Close[currentBar - 1] &&
                Data.Open[currentBar - 1] < Data.Open[currentBar - 2] && Data.Open[currentBar - 1] > Data.Close[currentBar - 2])
            {
                Found[currentBar] = true;
            }
        }