Description
Follow my cTrader Telegram group at https://t.me/cTraderCommunity; everyone can talk about cTrader indicators and algorithm without restrictions, though it is not allowed to spam commercial indicators to sell them. There's also a Discord Server now @ https://discord.gg/5GAPMtp and an Instagram page https://www.instagram.com/ctrader_community/
This indicator shows you where a Belkhayate OB/OS signal is by coloring the background of the chart.
Color instensity and opacity are settable.
For any bug report or suggestion, follow my telegram group or comment below
using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;
namespace cAlgo
{
[Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class BelkhayateAlert : Indicator
{
[Parameter("Max Color Intensity", DefaultValue = 255, MinValue = 0, MaxValue = 255)]
public int MAxInt { get; set; }
[Parameter("Opacity", DefaultValue = 255, MinValue = 0, MaxValue = 255)]
public int Opc { get; set; }
private BelkhayatePolynomialRegressionHistory bk;
[Output("Main")]
public IndicatorDataSeries Result { get; set; }
protected override void Initialize()
{
bk = Indicators.GetIndicator<BelkhayatePolynomialRegressionHistory>(3, 120, 1.4, 2.4, 3.4, MarketSeries.Close);
}
public override void Calculate(int index)
{
if (!IsLastBar)
return;
int red = (int)Math.Max(-(MAxInt * (MarketSeries.Close[index] - bk.Hprc[index]) / (bk.Hsqh3[index] - bk.Hprc[index])), 0);
int green = (int)Math.Max((MAxInt * (MarketSeries.Close[index] - bk.Hprc[index]) / (bk.Hsqh3[index] - bk.Hprc[index])), 0);
Chart.ColorSettings.BackgroundColor = Color.FromArgb(Opc, red, green, 0);
}
}
}
CY
cysecsbin.01
Joined on 10.11.2018 Blocked
- Distribution: Free
- Language: C#
- Trading platform: cTrader Automate
- File name: Belkhayate Alert.algo
- Rating: 0
- Installs: 1891
- Modified: 13/10/2021 09:54
Note that publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section, please use the Copyright Infringement Notification form to submit a claim.
Comments
Log in to add a comment.
No comments found.