Category Oscilators  Published on 07/02/2023

Narrow Range indicator

Description

Narrow Range indicator

The proposed indicator aims to measure the squeeze of market range price, by identifying the bar of lowest average true range value after a number of bars. After identifying the narrow range the new market pressure will happened in correction or new impulse price.


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

namespace cAlgo
{
    [Levels(0,1)]
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class mNarrowRange : Indicator
    {
        [Parameter("Period (4|7)", DefaultValue = 7)]
        public int inpPeriod { get; set; }
    
        [Output("NarrowRange", LineColor = "Black", PlotType = PlotType.Histogram, Thickness = 4)]
        public IndicatorDataSeries outNR { get; set; }
        
        private IndicatorDataSeries _range, _minrange;
        

        protected override void Initialize()
        {
            _range = CreateDataSeries();
            _minrange = CreateDataSeries();
        }

        public override void Calculate(int i)
        {
            _range[i] = Bars.HighPrices[i] - Bars.LowPrices[i];
            _minrange[i] = _range.Minimum(inpPeriod);
             
            outNR[i] = _range[i] < _minrange[i-1] ? +1 : 0;
        }
    }
}

mfejza's avatar
mfejza

Joined on 25.01.2022

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: mNarrowRange.algo
  • Rating: 5
  • Installs: 95
  • Modified: 19/08/2024 08:26
Comments
Log in to add a comment.
BillionsBobby's avatar
BillionsBobby · 1 week ago

Hi mfejza, loving your indicators, your work is amazing. 

Is it possible to create an alert for this bot? When the signal comes to either have a popup on ctrader or a telegram message?

Many thanks

WE
weelmedia · 1 year ago

Your writing is excellent, so allow me to share a little of myself. One of the best available limitless running games is retro games. Control your ball as you compete in a fast ramp race to see how far you can climb the leaderboard.

SA
safetycasino1 · 1 year ago

When I read an article on this topic, 카지노게임사이트 the first thought was profound and difficult, and I wondered if others could understand..  My site has a discussion board for articles and photos similar to this topic. Could you please visit me when you have time to discuss this topic?