HiLo Range indicator free

by mfejza in category Oscilator at 16/01/2023
Description

HiLo Range indicator.

Trade long when indicator is above zero level, trade Short when indicator is below the zero level.

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.Collections;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;

namespace cAlgo
{
    [Levels(0, -100, +100)]
    [Indicator(AccessRights = AccessRights.None)]
    public class mHILOrange : Indicator
    {
        [Parameter("Range Bars (40)", DefaultValue = 40)]
        public int inpRangeBars { get; set; }
        
        [Output("High/Low Range", LineColor = "Black", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
        public IndicatorDataSeries outHILOrange { get; set; }
        
        private IndicatorDataSeries _hh, _ll, _hl, _hlr;
            

        protected override void Initialize()
        {
            _hh = CreateDataSeries();
            _ll = CreateDataSeries();
            _hl = CreateDataSeries();
            _hlr = CreateDataSeries();
        }

        public override void Calculate(int i)
        {
            _hh[i] = i>inpRangeBars ? Bars.HighPrices.Maximum(inpRangeBars) : Bars.HighPrices[i];
            _ll[i] = i>inpRangeBars ? Bars.LowPrices.Minimum(inpRangeBars) : Bars.LowPrices[i];
            _hl[i] = _hh[i] - _ll[i];
            _hlr[i] = _hl[i] != 0 ? (200.0 * (((Bars.HighPrices[i] + Bars.LowPrices[i]) / 2.0) - _ll[i]) / _hl[i]) - 100 : 0;
            
            outHILOrange[i] = _hlr[i];
        }
    }
}
Comments

olsenelizabeth940 - January 18, 2023 @ 10:12

Forex trading is getting so much famous nowadays that many of my friends have also started to invest in it. I work for assignments companies in MY and thinking to invest in it. trying new things is great for your mental health.

0