Description
This indicator is based on "Ichimoku", and with its additional and useful features, it can help traders to get the right positions and help analysts to have an accurate analysis.
Additional features used in this indicator are:
- It has two extra KijunSen that user can adjust the period and properties of their lines.(eg 103 and 207)
- It has a QualityLine and DirectionLine, which is the same KijunSen that shift 26 Candle to the front and back.
Using these two lines can be a great help in Trading and analysis. - There is a separate "KijunSen" and "TenkanSen" With different settings for shifting forward or backward to the user's desired number
- Adjust and modify the Kumo and Chikou and TenkenSen and extra KijunSen and QualityLine and DirectionLine shift to the desired value.
- Adjust and change the color of the Kumo.
- All features above have the ability to enable or disable, And the user can change their properties, such as color, thickness and type of lines and points.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using cAlgo.API;
using cAlgo.API.Collections;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
namespace cAlgo
{
[Indicator(IsOverlay = true, TimeZone = TimeZones.EasternStandardTime, AccessRights = AccessRights.None, AutoRescale = false)]
[Cloud("Kumo Up", "Kumo Down", Opacity = 0.3)]
public class IchimokuPlusDots : Indicator
{
#region parameters
[Parameter("TenkanSen", DefaultValue = 9, MinValue = 1, Group = "Period")]
public int TenkanSenPeriods { get; set; }
[Parameter("KijunSen", DefaultValue = 26, MinValue = 1, Group = "Period")]
public int KijunSenPeriods { get; set; }
[Parameter("SenkouSpanB", DefaultValue = 52, MinValue = 1, Group = "Period")]
public int SenkouSpanBPeriods { get; set; }
[Parameter("KijunSen extra1", DefaultValue = 103, MinValue = 1, Group = "Period")]
public int KijunSenExtra1Periods { get; set; }
[Parameter("KijunSen extra2", DefaultValue = 207, MinValue = 1, Group = "Period")]
public int KijunSenExtera2Periods { get; set; }
[Parameter("TenkanSen +17", DefaultValue = 9, MinValue = 1, Group = "Period")]
public int TenkanSen17Periods { get; set; }
[Parameter("QualityLine", DefaultValue = 26, MinValue = 1, Group = "Period")]
public int QualityLinePeriod { get; set; }
[Parameter("DirectionLine", DefaultValue = 26, MinValue = 1, Group = "Period")]
public int DirectionLinePeriod { get; set; }
[Parameter("ChikouSpan Shift", DefaultValue = -26, MaxValue = 9999, Group = "Shift")]
public int ChikouSpanShift { get; set; }
[Parameter("Kumo Shift", DefaultValue = 26, MinValue = -9999, Group = "Shift")]
public int KumoShift { get; set; }
[Parameter("TenkanSen +17", DefaultValue = 17, MinValue = -9999, Group = "Shift")]
public int TenkanSen17Shift { get; set; }
[Parameter("QualityLine", DefaultValue = 26, MinValue = -9999, Group = "Shift")]
public int QualityLineShift { get; set; }
[Parameter("DirectionLine", DefaultValue = -26, MaxValue = 9999, Group = "Shift")]
public int DirectionLineShift { get; set; }
[Parameter("KijunSen extra1", DefaultValue = 1, MinValue = -9999, Group = "Shift")]
public int KijunSenExtra1Shift { get; set; }
[Parameter("KijunSen extra2", DefaultValue = 1, MinValue = -9999, Group = "Shift")]
public int KijunSenExtra2Shift { get; set; }
[Output("TenkanSen", PlotType = PlotType.Line, LineColor = "Red")]
public IndicatorDataSeries TenkanSenResult { get; set; }
[Output("TenkanSenDots", PlotType = PlotType.Points, LineColor = "Red", Thickness = 2)]
public IndicatorDataSeries TenkanSenDResult { get; set; }
[Output("KijunSen", PlotType = PlotType.Line, LineColor = "Blue")]
public IndicatorDataSeries KijunSenResult { get; set; }
[Output("KijunSenDots", PlotType = PlotType.Points, LineColor = "Blue", Thickness = 2)]
public IndicatorDataSeries KijunSenDResult { get; set; }
[Output("ChikuSpan", PlotType = PlotType.Line, LineColor = "Green")]
public IndicatorDataSeries ChikouSpanResult { get; set; }
[Output("Kumo Up", PlotType = PlotType.Line, LineColor = "Green")]
public IndicatorDataSeries KumoUpResult { get; set; }
[Output("Kumo Down", PlotType = PlotType.Line, LineColor = "FFFF6666")]
public IndicatorDataSeries KumoDownResult { get; set; }
[Output("SenkouSpanADots", PlotType = PlotType.Points, LineColor = "Green", Thickness = 2)]
public IndicatorDataSeries SenkouSpanAResult { get; set; }
[Output("SenkouSpanBDots", PlotType = PlotType.Points, LineColor = "FFFF6666", Thickness = 2)]
public IndicatorDataSeries SenkouSpanBResult { get; set; }
[Output("KijunSen extra1", PlotType = PlotType.Line, LineColor = "green")]
public IndicatorDataSeries KijunSenExtra1Result { get; set; }
[Output("KijunSen extra1Dots", PlotType = PlotType.Points, LineColor = "green", Thickness = 2)]
public IndicatorDataSeries KijunSenExtra1DResult { get; set; }
[Output("KijunSen extra2", PlotType = PlotType.Line, LineColor = "orange")]
public IndicatorDataSeries KijunSenExtra2Result { get; set; }
[Output("KijunSen extra2Dots", PlotType = PlotType.Points, LineColor = "orange", Thickness = 2)]
public IndicatorDataSeries KijunSenExtra2DResult { get; set; }
[Output("Tenkan +17", PlotType = PlotType.Line, LineColor = "yellow")]
public IndicatorDataSeries TenkanSen17Result { get; set; }
[Output("Tenkan +17Dots", PlotType = PlotType.Points, LineColor = "yellow", Thickness = 2)]
public IndicatorDataSeries TenkanSen17DResult { get; set; }
[Output("QualityLine", PlotType = PlotType.Line, LineColor = "Black")]
public IndicatorDataSeries QualityLineResult { get; set; }
[Output("QualityLineDots", PlotType = PlotType.Points, LineColor = "Black", Thickness = 2)]
public IndicatorDataSeries QualityLineDResult { get; set; }
[Output("DirectionLine", PlotType = PlotType.Line, LineColor = "Purple")]
public IndicatorDataSeries DirectionLineResult { get; set; }
[Output("DirectionLineDots", PlotType = PlotType.Points, LineColor = "Purple", Thickness = 2)]
public IndicatorDataSeries DirectionLineDResult { get; set; }
double High, Low, High1, Low1, High2, Low2, High3, Low3, High4, Low4, High5, Low5;
#endregion
#region Global Variables
private IchimokuKinkoHyo Ichimoku;
#endregion
protected override void Initialize()
{
// Initialize and create nested indicators
Ichimoku = Indicators.IchimokuKinkoHyo( TenkanSenPeriods, KijunSenPeriods, SenkouSpanBPeriods);
}
//END METHOD INITIALIZE
public override void Calculate(int index)
{
High = Bars.HighPrices[index];
Low = Bars.LowPrices[index];
High1 = Bars.HighPrices[index];
Low1 = Bars.LowPrices[index];
High2 = Bars.HighPrices[index];
Low2 = Bars.LowPrices[index];
High3 = Bars.HighPrices[index];
Low3 = Bars.LowPrices[index];
High4 = Bars.HighPrices[index];
Low4 = Bars.LowPrices[index];
High5 = Bars.HighPrices[index];
Low5 = Bars.LowPrices[index];
for (int i = 0; i < TenkanSen17Periods; i++)
{
if (High < Bars.HighPrices[index - i])
{
High = Bars.HighPrices[index - i];
}
if (Low > Bars.LowPrices[index - i])
{
Low = Bars.LowPrices[index - i];
}
}
for (int i = 0; i < QualityLinePeriod; i++)
{
if (High1 < Bars.HighPrices[index - i])
{
High1 = Bars.HighPrices[index - i];
}
if (Low1 > Bars.LowPrices[index - i])
{
Low1 = Bars.LowPrices[index - i];
}
}
for (int i = 0; i < DirectionLinePeriod; i++)
{
if (High2 < Bars.HighPrices[index - i])
{
High2 = Bars.HighPrices[index - i];
}
if (Low2 > Bars.LowPrices[index - i])
{
Low2 = Bars.LowPrices[index - i];
}
}
for (int i = 0; i < SenkouSpanBPeriods; i++)
{
if (High3 < Bars.HighPrices[index - i])
{
High3 = Bars.HighPrices[index - i];
}
if (Low3 > Bars.LowPrices[index - i])
{
Low3 = Bars.LowPrices[index - i];
}
}
for (int i = 0; i < KijunSenExtra1Periods; i++)
{
if (High4 < Bars.HighPrices[index - i])
{
High4 = Bars.HighPrices[index - i];
}
if (Low4 > Bars.LowPrices[index - i])
{
Low4 = Bars.LowPrices[index - i];
}
}
for (int i = 0; i < KijunSenExtera2Periods; i++)
{
if (High5 < Bars.HighPrices[index - i])
{
High5 = Bars.HighPrices[index - i];
}
if (Low5 > Bars.LowPrices[index - i])
{
Low5 = Bars.LowPrices[index - i];
}
}
TenkanSenResult[index] = Ichimoku.TenkanSen[index];
KijunSenResult[index] = Ichimoku.KijunSen[index];
ChikouSpanResult[index + ChikouSpanShift+1] = Bars.ClosePrices[index];
SenkouSpanAResult[index + KumoShift-1] = (TenkanSenResult[index] + KijunSenResult[index]) / 2;
SenkouSpanBResult[index + KumoShift-1] = ((High3 + Low3) / 2);
TenkanSen17Result[index + TenkanSen17Shift] = ((High + Low) / 2);
QualityLineResult[index + QualityLineShift-1] = ((High1 + Low1) / 2);
DirectionLineResult[index + DirectionLineShift+1] = ((High2 + Low2) / 2);
KijunSenExtra1Result[index + KijunSenExtra1Shift-1] = ((High4 + Low4) / 2);
KijunSenExtra2Result[index + KijunSenExtra2Shift-1] = ((High5 + Low5) / 2);
KumoUpResult[index + KumoShift-1] = (TenkanSenResult[index] + KijunSenResult[index]) / 2;
KumoDownResult[index + KumoShift-1] = ((High3 + Low3) / 2);
TenkanSenDResult[index] = Ichimoku.TenkanSen[index];
KijunSenDResult[index] = Ichimoku.KijunSen[index];
TenkanSen17DResult[index + TenkanSen17Shift] = ((High + Low) / 2);
QualityLineDResult[index + QualityLineShift-1] = ((High1 + Low1) / 2);
DirectionLineDResult[index + DirectionLineShift+1] = ((High2 + Low2) / 2);
KijunSenExtra1DResult[index + KijunSenExtra1Shift-1] = ((High4 + Low4) / 2);
KijunSenExtra2DResult[index + KijunSenExtra2Shift-1] = ((High5 + Low5) / 2);
}
//END METHOD CALCULATE
}
//END class DisplayDWMPipsonCharts
}
//END namespace cAlgo
ichimoku.trader
Joined on 27.03.2022
- Distribution: Free
- Language: C#
- Trading platform: cTrader Automate
- File name: IchimokuPlus(Dots).algo
- Rating: 5
- Installs: 491
- Modified: 04/05/2024 18:25
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.