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
AI-assisted
Predictive Monte Carlo Engine Forecast future price paths using institutional-grade statistical models and probability
Indicador
ATR
Volume
+1
The UT Bot identify potential trend reversals and momentum shifts.
Indicador
MSS
Market Structure
+2
Smart structural zones with pivot detection, ATR adaptation, sound alerts, and auto-color UI for precise entries.
Indicador
BOS
CHOCH
+2
The full SMC suite: structure BOS CHoCH MSS , FVG, liquidity, order blocks & a 0 to100 confluence score. No repaint.
Indicador
RSI
Breakout
+1
Price action to detect when the market changes trend (MSB) and defines, order blocks , ZigZag etc.📊
Indicador
Forex
EURUSD
+4
A precision overlay tool that combines session-aware VWAP logic and standard deviations.
Indicador
Prop
Forex
+11
Market Structure Shift – Professional Market Structure Oscillator
Indicador
Prop
Forex
+11
⚡Nebula Range Filter is a professional trend filter indicator for cTrader⚡
Indicador
Key Levels
Market Structure
+1
Sessions, ICT killzones, multi-ORB and previous levels. One clean, no-repaint cTrader overlay.
Indicador
ATR
RSI
+5
One of the best indicators we have ever developed, with a very high profit ratio.
Indicador
SMC
Prop
+12
Multi-TF FVG + Smart Fibonacci
Indicador
VWAP
Volume
+4
Volume Profile + VWAP with Standard Deviations
Indicador
BOS
CHOCH
+4
Dual-track market structure detection with BVC order flow confirmation and two-stage liquidity sweep validation.
Indicador
SMC
Forex
+5
Detect institutional breakout zones with smart volume & channel analysis — by PrimeQuant.
Indicador
Prop
Forex
+4
HMA MTF 2.0 (Multi-Timeframe )
Indicador
SMC
Forex
+5
Pinpoint FVGs, track fills and see mitigation stats — trade imbalances with clarity and confidence.
Indicador
Forex
BTCUSD
+6
Multi-pole Gaussian filter channel with dynamic color, Reduced Lag & Fast Response modes. Port of DonovanWall's original
Indicador
Prop
Forex
+2
⚔️ JPY Samurai Breakout Pro — Professional Breakout Indicator for cTrader ⚔️
3
Instalaciones gratis