Trading product for Doji Engulf Indicador, image 1
Indicador
3 descargas
Versión 1.0, Jul 2025
Windows, Mac
3
Instalaciones gratis

using cAlgo.API;

using cAlgo.API.Indicators;

using cAlgo.API.Internals;

using System;


namespace cAlgo.Indicators

{

[Indicator(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]

public class DojiStrategyIndicator : Indicator

{

[Parameter("Tamaño Doji", DefaultValue = 0.05, MinValue = 0.01, Step = 0.01)]

public double DojiSize { get; set; }


[Parameter("Proporción de Vela Larga", DefaultValue = 0.7, MaxValue = 1, Step = 0.1)]

public double LongCandleRatio { get; set; }


[Parameter("¿Usar filtro de volumen?", DefaultValue = false)]

public bool UseVolumeFilter { get; set; }


[Parameter("Periodo de media móvil de volumen", DefaultValue = 24)]

public int VolumeMA { get; set; }


[Parameter("Periodo RSI", DefaultValue = 14)]

public int RSIPeriod { get; set; }


[Parameter("Proporción mecha-cuerpo", DefaultValue = 2.5, MinValue = 1.0, Step = 0.1)]

public double WickToBodyRatio { get; set; }


private MovingAverage volumeMA;

private RelativeStrengthIndex rsi;


[Output("Señal Doji", Color = Colors.Orange, PlotType = PlotType.Points, Thickness = 2)]

public IndicatorDataSeries DojiSignal { get; set; }


protected override void Initialize()

{

if (UseVolumeFilter)

volumeMA = Indicators.MovingAverage(MarketSeries.TickVolume, VolumeMA, MovingAverageType.Simple);


rsi = Indicators.RelativeStrengthIndex(MarketSeries.Close, RSIPeriod);

}


public override void Calculate(int index)

{

double body = MarketSeries.Close[index] - MarketSeries.Open[index];

double range = MarketSeries.High[index] - MarketSeries.Low[index];

double abody = Math.Abs(body);

double ratio = abody / range;


bool isDoji = abody <= range * DojiSize;

bool goStar = isDoji && (!UseVolumeFilter || MarketSeries.TickVolume[index] > volumeMA.Result[index]);


if (goStar && IsHigherTimeFrame(out int timeFrameNumber, out string label))

{

DojiSignal[index] = MarketSeries.Close[index]; // Marcar el Doji en el gráfico

Chart.DrawIcon("Doji" + TimeFrame.ToString() + index, ChartIconType.Diamond, index, MarketSeries.Close[index], Color.Orange);


// Resaltar el máximo y mínimo de la vela Doji con líneas sólidas que se extienden sobre las siguientes 3 velas

HighlightDojiHighLow(index, timeFrameNumber, label);

}


// La detección de divergencia SMT ahora se aplica a todos los marcos temporales

DetectSMTDivergence(index);

}


private bool IsHigherTimeFrame(out int timeFrameNumber, out string label)

{

timeFrameNumber = 0;

label = string.Empty;


if (TimeFrame == TimeFrame.Minute15)

{

timeFrameNumber = 15;

label = "0.25";

return true;

}

else if (TimeFrame == TimeFrame.Minute30)

{

timeFrameNumber = 30;

label = "0.5";

return true;

}

else if (TimeFrame == TimeFrame.Minute45)

{

timeFrameNumber = 45;

label = "0.75";

return true;

}

else if (TimeFrame == TimeFrame.Hour)

{

timeFrameNumber = 1;

label = "1";

return true;

}

else if (TimeFrame == TimeFrame.Hour2)

{

timeFrameNumber = 2;

label = "48";

return true;

}

else if (TimeFrame == TimeFrame.Hour4)

{

timeFrameNumber = 4;

label = "4";

return true;

}

else if (TimeFrame == TimeFrame.Daily)

{

timeFrameNumber = 24;

label = "24";

return true;

}

else if (TimeFrame == TimeFrame.Weekly)

{

timeFrameNumber = 168;

label = "S";

return true;

}

else if (TimeFrame == TimeFrame.Monthly)

{

timeFrameNumber = 720;

label = "M";

return true;

}


return false;

}


private void HighlightDojiHighLow(int dojiIndex, int timeFrameNumber, string label)

{

double dojiHigh = MarketSeries.High[dojiIndex];

double dojiLow = MarketSeries.Low[dojiIndex];


// Dibujar líneas horizontales sólidas en el máximo y mínimo de la vela Doji que se extienden sobre las siguientes 3 velas

Chart.DrawTrendLine("DojiHighLine" + TimeFrame.ToString() + dojiIndex, dojiIndex, dojiHigh, dojiIndex + 3, dojiHigh, Color.Blue, 2, LineStyle.Solid).IsInteractive = true;

Chart.DrawTrendLine("DojiLowLine" + TimeFrame.ToString() + dojiIndex, dojiIndex, dojiLow, dojiIndex + 3, dojiLow, Color.Red, 2, LineStyle.Solid).IsInteractive = true;


// Añadir número de marco temporal o texto de etiqueta junto a la línea azul

Chart.DrawText("TimeFrameHigh" + TimeFrame.ToString() + dojiIndex, label, dojiIndex + 3, dojiHigh, Color.Green).IsInteractive = true;

}


private void DetectSMTDivergence(int index)

{

// Comprobar si el máximo o mínimo actual forma una divergencia con el RSI

double currentHigh = MarketSeries.High[index];

double currentLow = MarketSeries.Low[index];


double prevHigh = MarketSeries.High[index - 1];

double prevLow = MarketSeries.Low[index - 1];


double currentRSI = rsi.Result[index];

double prevRSI = rsi.Result[index - 1];


bool isWickDivergence = IsWickDivergence(index, currentHigh, currentLow, prevHigh, prevLow);


if (isWickDivergence)

{

// Divergencia bajista: El precio hace un máximo más alto, el RSI hace un máximo más bajo

if (currentHigh > prevHigh && currentRSI < prevRSI)

{

// Marcar la divergencia en el gráfico con un identificador único para este marco temporal

Chart.DrawIcon("BearishDivergence" + TimeFrame.ToString() + index, ChartIconType.DownArrow, index, currentHigh, Color.Red);

}


// Divergencia alcista: El precio hace un mínimo más bajo, el RSI hace un mínimo más alto

if (currentLow < prevLow && currentRSI > prevRSI)

{

// Marcar la divergencia en el gráfico con un identificador único para este marco temporal

Chart.DrawIcon("BullishDivergence" + TimeFrame.ToString() + index, ChartIconType.UpArrow, index, currentLow, Color.Green);

}

}

}


private bool IsWickDivergence(int index, double currentHigh, double currentLow, double prevHigh, double prevLow)

{

double currentBody = Math.Abs(MarketSeries.Close[index] - MarketSeries.Open[index]);

double currentRange = currentHigh - currentLow;


double prevBody = Math.Abs(MarketSeries.Close[index - 1] - MarketSeries.Open[index - 1]);

double prevRange = prevHigh - prevLow;


// Determinar si la vela actual tiene un cuerpo pequeño y mechas largas

bool currentHasLongWicks = (currentHigh - MarketSeries.Close[index]) > currentBody * WickToBodyRatio &&

(MarketSeries.Open[index] - currentLow) > currentBody * WickToBodyRatio;


// Determinar si la vela anterior tiene un cuerpo pequeño y mechas largas

bool prevHasLongWicks = (prevHigh - MarketSeries.Close[index - 1]) > prevBody * WickToBodyRatio &&

(MarketSeries.Open[index - 1] - prevLow) > prevBody * WickToBodyRatio;


return currentHasLongWicks || prevHasLongWicks;

}

}

}

Perfil del indicador
0.0
Valoraciones: 0
Valoraciones de clientes
Este producto todavía no se ha valorado. ¿Ya lo ha probado? Sea el primero en informar a otros.
Los productos disponibles a través de cTrader Store, incluidos bots, indicadores y plugins para operar, son proporcionados por desarrolladores de terceros y están disponibles únicamente con fines informativos y de acceso técnico. cTrader Store no es un bróker, por lo que no proporciona asesoramiento de inversión, recomendaciones personales ni ninguna garantía de rentabilidad futura.

Más de este autor

Indicador
The Session Golden Hours indicator is designed for serious traders looking to visualize high-probability

Puede interesarle

Indicador
Bollinger
Jurik Moving Average (Jurik's Moving Average) triple adaptive filter with unique Jurik smoothing and dynamic factor.
Indicador
Order Block
Fair Value Gap
+2
This indicator contains most of the ICT strategies that you need. You can turn on/off each one to be shown.
Indicador
RSI
MACD
+3
A comprehensive cTrader indicator designed to give you a quick, at-a-glance understanding of market sentiment 📈📉
Indicador
Volume
Order Block
+1
Elevate your market analysis with the Aggression Delta Volume Profile, a premium, institutional-grade order flow utility
Indicador
RSI
Breakout
+1
"Identify key market zones and visualize support/resistance from multiple timeframes on a single chart.
Indicador
Prop
Forex
+4
Personal trade tracker for a single symbol. Clear net profit summary — FreshNet, ManageNet, DayNet, WTDNet, MTDNet.
Indicador
Forex
BTCUSD
+11
📈 Adaptive ALMA-Gaussian hybrid trend filter with precision smoothing and clear buy/sell signals.
Indicador
EMA
SMA
+5
Trend Blueprint All-in-One Trend & Structure
Indicador
ATR
Engulfing
+5
This indicator maps D1, H4, H1 and 15M Multi-Timeframe Bias and Fresh High Probability Supply and Demand zones
Indicador
ATR
Signal
One of the best indicators we have ever developed, with a very high profit ratio.
Indicador
Signal
Fractal Arrow Buy and Sell Indicator
Indicador
Prop
Forex
+4
HMA MTF 2.0 (Multi-Timeframe )
Indicador
AI
Grid
+17
🔍 Discover All Candlestick Patterns… Absolutely Free!
Indicador
Prop
Forex
+5
🎯 Order Block Detector - Smart Trading: Identifica bloques de órdenes clave en cTrader para un trading más inteligente.
Indicador
SMC
Prop
+8
KILLZONES AND MACRO SESSIONS
Indicador
Highlights market sessions & overlaps with real-time range & volume stats – perfect for pro scalpers.
Indicador
SMC
Prop
+15
Automatic Elliott Wave Detection with Professional Filters
Indicador
MSS
Key Levels
+4
Maps session ranges, previous highs/lows, equilibrium and premium/discount zones on your cTrader chart.
3
Instalaciones gratis