Doji Engulf
Indicador
3 descargas
Versión 1.0, Jul 2025
Windows, Mac
3
Instalaciones gratis

Descripción

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;

}

}

}

Resumen

Perfil del indicador

Valoraciones de clientes

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.

Conversación

Preguntas frecuentes

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
AI
ATR
+27
VolumeProfileSuite is an advanced and flexible Volume Profile indicator for cTrader.
Indicador
AI
ATR
+10
FX Sniper: Multi-pair Forex analysis tool. Features trend logic, adaptive pivots, and momentum filtering for major pairs
Indicador
VWAP
Forex
+7
VWAP + Swing Liquidity + SFP Signals — detects liquidity sweeps with color-coded alerts.
Indicador
Prop
Forex
+14
Stochastic Momentum Index (SMI) for cTrader optional higher-timeframe source, and clear overbought/oversold levels.
Indicador
AI
ATR
+27
Support and Resistance with signals
Indicador
Grid
Forex
+4
indicator showing the Daily Open Line and instantly shading bullish and bearish zones.
Indicador
XAUUSD
Commodities
A Fair Value Gap (FVG) indicator that identifies potential price imbalances, potential reversal and continuation zones
Indicador
Key Levels
Market Structure
+1
Sessions, ICT killzones, multi-ORB and previous levels. One clean, no-repaint cTrader overlay.
Indicador
Bollinger
Jurik Moving Average (Jurik's Moving Average) triple adaptive filter with unique Jurik smoothing and dynamic factor.
Indicador
This is the trial version of Time To Break Even, which help you time your trade entry.
Indicador
ADX
EMA
+4
A multi-timeframe dashboard for cTrader that scores trend direction, momentum, and strength across M15, H1, H4, and D1.
Indicador
Inside Bar
Save time by lighting a candle to look within yourself in another temporality
Indicador
AI
SMC
+5
Coloring trendline/ Colored Trendline / Color Trendline
Indicador
Prop
Forex
+7
The Parabolic SAR, or "Stop and Reverse," is a dynamic technical analysis tool.
Indicador
ATR
BOS
+3
Fair Value Gaps with Multi-Timeframe.
Indicador
Key Levels
Liquidity Grab
+3
Visual market context dashboard showing bias states, CE positioning, session status and sweep context.
Indicador
RSI
VegaXLR's cTrader StochRSI identifies overbought/oversold RSI levels for precise trade entries.
Indicador
Forex
BTCUSD
+9
On-chart economic calendar with custom filters and automated Telegram alerts. Never miss high-impact news!

Precio

3
Instalaciones gratis