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
Forex
Crypto
+3
Consecutive Series Moves — Reveal the True Pulse of Price Action
Indicador
Key Levels
Liquidity Grab
+3
Visual market context dashboard showing bias states, CE positioning, session status and sweep context.
Indicador
Indices
Custom ADX Indicator for precise trend analysis. المؤشر المخصص ADX لتحليل الاتجاه بدقة
Indicador
ATR
CCI
+5
An institutional-grade trading system fusing triple hybrid moving averages, multi-oscillator momentum filters, Fair Valu
Indicador
Forex
GBPUSD
+3
Support & resistance zones with measured hold rates and confidence intervals — evidence, not just lines on a chart.
Indicador
Key Levels
Drawdown Monitor
+1
[ANALYTICAL/INFORMATIONAL] Track NET positions, Break-Even & Drawdown. No order execution.
Indicador
Forex
BTCUSD
+11
Auto-detects Bullish/Bearish Engulfing patterns to spot trend reversals. Real-time alerts, custom colors, all symbols.
Indicador
Spot Strong Trends Early & Filter Market Noise
Indicador
Supply & Demand
Support & Resistance
RAF Supply Demand Lite v1.0 automatically detects clean Supply and Demand zones using confirmed swing highs and lows. Zo
Indicador
ATR
RSI
+16
This trading game allows you to explore and practice investment strategies in a real-time market data environment.
Indicador
Forex
BTCUSD
+10
🎯Smart Signals : Auto Buy/Sell alerts with dynamic TP/SL algorithm. 💡
Indicador
VWAP
Volume
+4
Volume Profile + VWAP with Standard Deviations
Indicador
RSI
BTCUSD
+5
Identify market structure effortlessly with swing highs, lows, CHoCH, and BOS levels for smart trading decisions! 📊🔍"
Indicador
SMC
Prop
+15
Auto-detects Swing Highs/Lows to draw dynamic Support & Resistance levels with break tracking.
Indicador
BOS
Imbalance
+4
Automatically detects and highlights both Bullish and Bearish Fair Value Gaps (FVGs).
Indicador
ATR
SMC
+15
Plot ATR-based SL and 1R/2R/3R TPs instantly for any trade, with clear R-multiple risk mapping.
Indicador
SMC
Grid
+16
Institutional Supply & Demand Mapping Across Five Timeframes — Automatically.
Logotipo de "supertrend"
Popular
4.3
(3)
$20
Indicador
ATR
Prop
+4
Supertrend Indicator for cTrader
3
Instalaciones gratis