Category Trend  Published on 11/06/2016

Cyf_Elder_Ray

Description

Elder Ray 

Developed by Alexander Elder

Also Known as Bull Power & Bear Power 

Crucial Part of this indicator is a trending market that respects an EMA , Elder used 26 Periods for weekly TF

This is a trend following Indicator and mainly depends on the skill of the trader .

Setup 

1-Put an EMA on the chart and adjust its periods till prices are respecting the EMA

2-Put the Elder Ray Indicator and Choose Yes in the options menu . (Adjust colors for Bulls)

   *Set Period Parameter exactly as your EMA Periods

3-Put the Elder Ray Indicator for the 2nd time and Choose No in the options menu .(Adjust colors for Bears)

  *Set Period Parameter exactly as your EMA Periods

Ex. 20 period Ema --> Bull Power Period = 20 & Bear Power Period = 20

Up Tick on Bear Power means Bear Power has become Bullish

Dn Tick on Bull Power means Bull Power has become Bearish 

There is a complete description for how to use this indicator in Elder's Book "Come Into my Trading Room"

This is Mainly a Swing Trading Indicator 

Update

-Cleaning code 

-Default to Yes (Bull)

-Default to Line Thickness 3


using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;

namespace cAlgo
{
    [Indicator(IsOverlay = false, AutoRescale = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class Cyf_Elder_Ray : Indicator
    {

        private ExponentialMovingAverage EMA;

        [Parameter("(Y)Bull/(N)Bear", DefaultValue = true)]
        public bool Draw { get; set; }

        [Parameter("Period", DefaultValue = 22)]
        public int Period { get; set; }

        [Output("Up Power", PlotType = PlotType.Histogram, Color = Colors.White, Thickness = 3)]
        public IndicatorDataSeries Bull { get; set; }

        [Output("Dn Power", PlotType = PlotType.Histogram, Color = Colors.DodgerBlue, Thickness = 3)]
        public IndicatorDataSeries Bear { get; set; }

        protected override void Initialize()
        {
            EMA = Indicators.ExponentialMovingAverage(MarketSeries.Close, Period);

        }

        public override void Calculate(int index)
        {
            var TheBull = double.NaN;
            var TheBear = double.NaN;
            if (Draw)
            {
                TheBull = (MarketSeries.High[index] - EMA.Result[index]);
                if (TheBull > 0)
                {
                    Bull[index] = TheBull;
                }
                else
                    Bear[index] = TheBull;




            }
            else if (Draw == false)
            {
                TheBear = (MarketSeries.Low[index] - EMA.Result[index]);
                if (TheBear > 0)
                {
                    Bull[index] = TheBear;
                }
                else
                    Bear[index] = TheBear;

            }

        }

    }
}





cyfer's avatar
cyfer

Joined on 27.09.2015

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: Cyf_Elder_Ray.algo
  • Rating: 0
  • Installs: 3090
  • Modified: 13/10/2021 09:54
Comments
Log in to add a comment.
No comments found.