Description
HiLo Range Fan indicator.
Trade long when all indicator components are above zero level, trade Short when all indicator components are below the zero level.
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 mHILOrangeFan : Indicator
{
[Parameter("Fast Range Bars (21)", DefaultValue = 21)]
public int inpRangeBarsFast { get; set; }
[Parameter("Medium Range Bars (55)", DefaultValue = 55)]
public int inpRangeBarsMedium { get; set; }
[Parameter("Slow Range Bars (144)", DefaultValue = 144)]
public int inpRangeBarsSlow { get; set; }
[Output("Fast High/Low Range", LineColor = "Black", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
public IndicatorDataSeries outHILOrangeFast { get; set; }
[Output("Medium High/Low Range", LineColor = "Red", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
public IndicatorDataSeries outHILOrangeMedium { get; set; }
[Output("Slow High/Low Range", LineColor = "CadetBlue", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
public IndicatorDataSeries outHILOrangeSlow { get; set; }
private IndicatorDataSeries _hhfast, _llfast, _hlfast, _hlrfast, _hhmedium, _llmedium, _hlmedium, _hlrmedium, _hhslow, _llslow, _hlslow, _hlrslow;
protected override void Initialize()
{
_hhfast = CreateDataSeries();
_llfast = CreateDataSeries();
_hlfast = CreateDataSeries();
_hlrfast = CreateDataSeries();
_hhmedium = CreateDataSeries();
_llmedium = CreateDataSeries();
_hlmedium = CreateDataSeries();
_hlrmedium = CreateDataSeries();
_hhslow = CreateDataSeries();
_llslow = CreateDataSeries();
_hlslow = CreateDataSeries();
_hlrslow = CreateDataSeries();
}
public override void Calculate(int i)
{
_hhfast[i] = i>inpRangeBarsFast ? Bars.HighPrices.Maximum(inpRangeBarsFast) : Bars.HighPrices[i];
_llfast[i] = i>inpRangeBarsFast ? Bars.LowPrices.Minimum(inpRangeBarsFast) : Bars.LowPrices[i];
_hlfast[i] = _hhfast[i] - _llfast[i];
_hlrfast[i] = _hlfast[i] != 0 ? (200.0 * (((Bars.HighPrices[i] + Bars.LowPrices[i]) / 2.0) - _llfast[i]) / _hlfast[i]) - 100 : 0;
_hhmedium[i] = i>inpRangeBarsMedium ? Bars.HighPrices.Maximum(inpRangeBarsMedium) : Bars.HighPrices[i];
_llmedium[i] = i>inpRangeBarsMedium ? Bars.LowPrices.Minimum(inpRangeBarsMedium) : Bars.LowPrices[i];
_hlmedium[i] = _hhmedium[i] - _llmedium[i];
_hlrmedium[i] = _hlmedium[i] != 0 ? (200.0 * (((Bars.HighPrices[i] + Bars.LowPrices[i]) / 2.0) - _llmedium[i]) / _hlmedium[i]) - 100 : 0;
_hhslow[i] = i>inpRangeBarsSlow ? Bars.HighPrices.Maximum(inpRangeBarsSlow) : Bars.HighPrices[i];
_llslow[i] = i>inpRangeBarsSlow ? Bars.LowPrices.Minimum(inpRangeBarsSlow) : Bars.LowPrices[i];
_hlslow[i] = _hhslow[i] - _llslow[i];
_hlrslow[i] = _hlslow[i] != 0 ? (200.0 * (((Bars.HighPrices[i] + Bars.LowPrices[i]) / 2.0) - _llslow[i]) / _hlslow[i]) - 100 : 0;
outHILOrangeFast[i] = _hlrfast[i];
outHILOrangeMedium[i] = _hlrmedium[i];
outHILOrangeSlow[i] = _hlrslow[i];
}
}
}
mfejza
Joined on 25.01.2022
- Distribution: Free
- Language: C#
- Trading platform: cTrader Automate
- File name: mHILOrangeFan.algo
- Rating: 5
- Installs: 760
- Modified: 16/01/2023 22:31
Comments
If you interested creative Lego creations or you collect own favorite Lego series, welcome to our Lego fan blog where you find latest news on Lego and more.
anybody, please block this spawner, and delete his comments
https://ctrader.com/users/profile/84471
I found your blog post to be a well-written and informative read. The examples you provided really helped to illustrate your points, and I appreciate the insights you shared on the topic. Keep up the good work! Liquid Xanax
Even my wife enjoyed this (and it did include the Garden of Eden sketch), thanks again for the flag. Purple Xanax
First You got a great blog .I will be interested in more similar topics. i see you got really very useful topics, i will be always checking your blog thanks. Buy Percocet
I found your blog post to be a well-written and informative read. The examples you provided really helped to illustrate your points, and I appreciate the insights you shared on the topic. Keep up the good work!<b><a href="https://xanaxshopca.com/product/liquid-xanax/" title="liquid xanax"> liquid xanax</a></b>
Anyone who can, please report this spawner and erase his comments. papa's freezeria