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
SMC
Prop
+17
Unlock the true intent of market participants with the Classic Proportional Cumulative Volume Delta CVD!
Indicador
Prop
Forex
+12
Identify and trade breakouts with Consolidation Zones! Visualize price consolidation areas for trading opportunities.
Indicador
ATR
RSI
+5
Visual indicator for identifying momentum reversals. Designed for forex (1h) and stocks (weekly).
Indicador
VWAP
Volume
+4
Volume Profile + VWAP with Standard Deviations
Indicador
ATR
SMC
+2
HTF POWER 3 ICT Power of 3 · M1 Precision · H4 Intelligence Auto-detect Accumulation → Manipulation → Distribution
Indicador
ATR
Engulfing
+3
Multi-timeframe Bias Alignment and Supply & Demand Zones Indicator.
Indicador
ATR
Forex
+7
Final Moving Average is an adaptive system designed to keep traders aligned with the true direction of the market
Indicador
AI
ATR
+27
VolumeProfileSuite is an advanced and flexible Volume Profile indicator for cTrader.
Indicador
Forex
BTCUSD
+9
💥Detects moments when the market is "compressed" and about to explode in any direction 💥
Indicador
VWAP
Forex
+13
Custom VWAP Indicator for cTrader
Indicador
ATR
BOS
+3
Identifies structure shifts, Supply & Demand zones, and delivers accurate BOS signals for clearer market movement.
Indicador
AI
SMC
+18
Smart Money Concepts (SMC)
Indicador
AI
ATR
+19
QX SessionBox ORB: Session boxes + ORB levels + clean dashboard with optional closed-candle breakout signals.
Indicador
ATR
Forex
+6
UT Bot Alerts Nova: Advanced trend-following indicator using ATR for signals. Precise entries/exits.
Logotipo de "PMAX"
Mejor valorado
5.0
(6)
Gratis
Indicador
ATR
Supertrend
It's a combination of two trailing stop loss and the other one is well-known ATR-based SuperTrend.
Indicador
Imbalance
Inside Bar
+3
A clean and powerful Smart Money Concepts tool combining Fair Value Gaps, Previous Daily High/Low, Inside/Outside bar
Indicador
ATR
CCI
+5
An institutional-grade trading system fusing triple hybrid moving averages, multi-oscillator momentum filters, Fair Valu
Indicador
Signal
Fractal Arrow Buy and Sell Indicator
3
Instalaciones gratis