Tabajara Indicator free

by andurei in category Trend at 06/11/2020
Description

Indicator developed by André Machado, a very skillful and experencied brazilian daytrader. This indicator helps the trader to trade with the trend.  

 

 

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 Tabajara : Indicator
    {
        [Parameter("Moving Average ", DefaultValue = 20)]
        public int Parameter { get; set; }

        [Parameter("Source")]
        public DataSeries Source { get; set; }

        private MovingAverage average;

        //[Output("Main")]
        //public IndicatorDataSeries Result { get; set; }


        protected override void Initialize()
        {

            average = Indicators.MovingAverage(Source, Parameter, MovingAverageType.Simple);



            // Initialize and create nested indicators
        }

        public override void Calculate(int index)
        {

            if (double.IsNaN(average.Result[index]) == false && Bars.ClosePrices[index] > average.Result[index] && Bars.OpenPrices[index] > average.Result[index] && Bars.OpenPrices[index] < Bars.ClosePrices[index])
            {

                Chart.SetBarColor(Bars.Count - 1, Color.Green);

            }


            if (double.IsNaN(average.Result[index]) == false && Bars.ClosePrices[index] < average.Result[index] && Bars.OpenPrices[index] < average.Result[index] && Bars.OpenPrices[index] > Bars.ClosePrices[index])
            {

                Chart.SetBarColor(Bars.Count - 1, Color.Red);

            }

            // Calculate value at specified index
            // Result[index] = ...
        }
    }
}
Comments