reversal bar free

by d.deel in category Other at 06/01/2021
Description

just a simple indicator to help those who have a hard time entering positions, not necessarily a trend base indicator, it' s recommended to use other indicators as well(add it to your stra)

in this caption other indicators are being used as well(indicators with their rightful owner), also not necessarily recommended 

 

 

 

purple for sell & blue for buy 

 

// if you have any feedbacks leave them in the comment section   

also before use, it is better to set your candle color and outline on transparent 

Caption

 

Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.
Formula / Source Code
Language: C#
Trading Platform: cAlgocTrader
´╗┐using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;

namespace cAlgo
{
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class Reversal_B_bars : Indicator
    {
        [Parameter("Thickness", Group = "thickness sett", DefaultValue = 5)]
        public int thi { get; set; }
        [Parameter("Bullish", Group = "Colors sett", DefaultValue = "Blue")]
        public string colo1 { get; set; }
        [Parameter("Bearish", Group = "Colors sett", DefaultValue = "Purple")]
        public string colo2 { get; set; }
        [Parameter("others", Group = "Colors sett", DefaultValue = "Black")]
        public string colo3 { get; set; }

        private int comfirmer_2;
        private DateTime starts;


        protected override void Initialize()
        {
            comfirmer_2 = 1;
        }

        public override void Calculate(int index)
        {
            starts = Bars.OpenTimes[index - 1];

            switch (comfirmer_2)
            {
                case -1:
                    bool T_down = Bars.ClosePrices[index - 1] < Bars.LowPrices[index - 2] && Bars.ClosePrices[index - 1] < Bars.LowPrices[index - 3];
                    if (T_down)
                    {
                        comfirmer_2 = 1;
                        Chart.DrawTrendLine("low_tren" + starts, starts, Bars.OpenPrices[index - 1], starts, Bars.ClosePrices[index - 1], color: colo2, thickness: thi);
                    }
                    else
                    {
                        if (Bars.HighPrices[index - 1] >= Bars.ClosePrices[index - 2] || Bars.LowPrices[index - 1] <= Bars.ClosePrices[index - 2])
                            Chart.DrawTrendLine("other" + starts, starts, Bars.OpenPrices[index - 1], starts, Bars.ClosePrices[index - 1], color: colo3, thickness: thi);
                    }
                    break;
                case 1:
                    bool T_up = Bars.ClosePrices[index - 1] > Bars.HighPrices[index - 2] && Bars.ClosePrices[index - 1] > Bars.HighPrices[index - 3];
                    if (T_up)
                    {
                        comfirmer_2 = -1;
                        Chart.DrawTrendLine("high_tren" + starts, starts, Bars.OpenPrices[index - 1], starts, Bars.ClosePrices[index - 1], color: colo1, thickness: thi);
                    }
                    else
                    {
                        if (Bars.HighPrices[index - 1] >= Bars.ClosePrices[index - 2] || Bars.LowPrices[index - 1] <= Bars.ClosePrices[index - 2])
                            Chart.DrawTrendLine("other_2" + starts, starts, Bars.OpenPrices[index - 1], starts, Bars.ClosePrices[index - 1], color: colo3, thickness: thi);
                    }
                    break;
            }
        }
    }
}
Comments
0