Category Oscilators  Published on 11/07/2022

Relative Strength Index (Bar Color UI)

Description

Relative Strength Index (Bar Color Base) 
 

Relative Strength Index (Bar Color Based)  Is A Visual Chart  Interface Rather Than RSI Being a Segregated oscillator indicator Which Would normally be displayed Below the chart.  Relative Strength Index (Bar Color Base) Indicator Overlays the OverBought and the Oversold Levels(Parameters that you can Manipulate, as well OHLC).  This Indicator Works best  with others Indicators. OverBought and the Oversold Levels Are changed with Bar Color Distinction. 

https://www.vivapeiro.com/

Example Purposes ONLY


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 Yo : Indicator
    {


        [Parameter("Periods", DefaultValue = 337)]
        public int perid { get; set; }

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




        [Parameter(DefaultValue = 70)]
        public int MaxLevel { get; set; }

        [Parameter(DefaultValue = 30)]
        public int MinLevel { get; set; }







        protected override void Initialize()
        {

            var vma = Indicators.RelativeStrengthIndex(Source, perid);



        }

        public override void Calculate(int index)
        {
            var Price = Source;

            var vma = Indicators.RelativeStrengthIndex(Source, perid);


            if (vma.Result.LastValue > MaxLevel)
            {

                Chart.SetBarColor(Price.Count, Color.FromHex("#00868A"));
            }

            if (vma.Result.LastValue < MinLevel)
            {
                Chart.SetBarColor(Price.Count, Color.FromHex("#D19292"));

            }
            return;


        }
    }
}


Fron's avatar
Fron

Joined on 08.01.2020

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: RelativeStrengthIndex(Bar Color Base).algo
  • Rating: 0
  • Installs: 1565
Comments
Log in to add a comment.
JO
jonfleon · 1 month ago

A good one for scalping. By the way, please advise how to change the color? Thanks