Category Trend  Published on 16/12/2023

Blau High-Low Momentum Channel (by Iba)

Description

The Blau High-Low Momentum indicator interprets price levels using high and low momentum to produce trend and range-bound confirmations. Commonly used for crossovers, divergence, and trend confirmation, the challenge lies in prioritizing the output to obtain the most accurate information for further trade decisions, combining all these factors.

In this custom indicator, derived from the Blau High-Low Momentum indicator, all these priorities are presented on the price chart as a channel. It indicates when the price momentum sentiment is in a range-bound or trending state, providing trading zones for both long and short positions when the price is above and below this channel. The price inside the channel is considered range-bound and in accumulation mode, with high-low momentum deciding the directional pressure move based on collected volume. The channel levels are also used as supply and demand-defined zones, correlating with price resistance and support. All the information produced by this indicator is based on continual highs and lows of previous pressures in the price history.

This custom indicator is used for zone trading. When the price is above the channel, the trading zone is marked only for long trades. Similarly, when the price is below the channel, the trading zone is marked only for short trades. 

This custom indicator is unique developed by Iba.

For more information about Blau High-Low Momentum indicator: https://ctrader.com/algos/indicators/show/3840


// This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/
// © mfejza
using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;

namespace cAlgo
{
    [Levels(0)]
    [Cloud("HighLowMomentum ChartHigh", "HighLowMomentum ChartLow", FirstColor = "Black", SecondColor = "Red" , Opacity = 0.02)]
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class mBlauHighLowMomentumChannel : Indicator
    {
        [Parameter("Momentum Period (2)", DefaultValue = 2, MinValue = 2)]
        public int inpMomentumPeriod { get; set; }
        [Parameter("First Smooth (20)", DefaultValue = 20, MinValue = 2)]
        public int inp1stSmoothPeriod { get; set; }
        [Parameter("Second Smooth (5)", DefaultValue = 5, MinValue = 2)]
        public int inp2ndSmoothPeriod { get; set; }
        [Parameter("Third Smooth (3)", DefaultValue = 3, MinValue = 2)]
        public int inp3rdSmoothPeriod { get; set; }

        [Output("HighLowMomentum ChartHigh", LineColor = "Red", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
        public IndicatorDataSeries outHLMhigh { get; set; }
        [Output("HighLowMomentum ChartLow", LineColor = "Green", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
        public IndicatorDataSeries outHLMlow { get; set; }
        
        private mBlauHighLowMomentum _hlm;
        private IndicatorDataSeries _highmom, _lowmom, _lasthighmom, _lastlowmom;


        protected override void Initialize()
        {
            _hlm = Indicators.GetIndicator<mBlauHighLowMomentum>(inpMomentumPeriod, inp1stSmoothPeriod, inp2ndSmoothPeriod, inp3rdSmoothPeriod);
            _highmom = CreateDataSeries();
            _lowmom = CreateDataSeries();
            _lasthighmom = CreateDataSeries();
            _lastlowmom = CreateDataSeries();
        }

        public override void Calculate(int i)
        {
            _highmom[i] = 
                  _hlm.outHLM[i-1] < 0 && _hlm.outHLM[i] > 0 ? Bars.HighPrices[i] 
                : _hlm.outHLM[i-1] > 0 && _hlm.outHLM[i] > 0 ? Math.Max(Bars.HighPrices[i], (i>1 ? _highmom[i-1] : Bars.ClosePrices[i])) 
                : i>1 ? _highmom[i-1] : Bars.ClosePrices[i];
             _lowmom[i] = 
                  _hlm.outHLM[i-1] > 0 && _hlm.outHLM[i] < 0 ? Bars.LowPrices[i] 
                : _hlm.outHLM[i-1] < 0 && _hlm.outHLM[i] < 0 ? Math.Min(Bars.LowPrices[i], (i>1 ? _lowmom[i-1] : Bars.ClosePrices[i])) 
                : i>1 ? _lowmom[i-1] : Bars.ClosePrices[i];
             _lasthighmom[i] = i>inpMomentumPeriod && _hlm.outHLM[i-1] < 0 && _hlm.outHLM[i] > 0 ? _highmom[i-1] : _lasthighmom[i-1]; 
             _lastlowmom[i] = i>inpMomentumPeriod && _hlm.outHLM[i-1] > 0 && _hlm.outHLM[i] < 0 ? _lowmom[i-1] : _lastlowmom[i-1]; 
            
            outHLMhigh[i] = _lasthighmom[i];
            outHLMlow[i] = _lastlowmom[i];
        }
    }
}


mfejza's avatar
mfejza

Joined on 25.01.2022

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: mBlauHighLowMomentumChannel.algo
  • Rating: 5
  • Installs: 465
Comments
Log in to add a comment.
No comments found.