Indicators with alerts/signal - page 1181

 

Dear Mladen,

Can you please look into this request ...

https://www.mql5.com/en/forum/180648/page787

Thanks a lot

 
rpasupathy:
Dear Mladen,

Can you please look into this request ...

https://www.mql5.com/en/forum/180648/page787

Thanks a lot

Rpasupathy, the indicator posted is a decompiled version, any chance you have the original source code of it?

 
mrtools:
Rpasupathy, the indicator posted is a decompiled version, any chance you have the original source code of it?

No ... I don't think so I have it ...

Thanks for taking time and looking into it ..

 
mrtools:
Rpasupathy, the indicator posted is a decompiled version, any chance you have the original source code of it?

Hi Mr Tools,

since i have very limited knowledge in coding what seems to be the problem with decompiled indicators ?

could you enlighten me about this

thanks

 

hi mrtools and mladen where can i get a proper darvas box indicator.. can u plz help ?

 
topi:
hi mrtools and mladen where can i get a proper darvas box indicator.. can u plz help ?

topi

Did you check this thread : https://www.mql5.com/en/forum/general

 

Stochastic email alert

Can somebody help my providing an alert to my indicator stochastic?

Thanks in advance

 

void CatchBullishDivergence(int shift)

{

if(IsIndicatorTrough(shift) == false)

return;

int currentTrough = shift;

int lastTrough = GetIndicatorLastTrough(shift);

//--CLASSIC DIVERGENCE--//

if (DisplayClassicalDivergences == true)

{

if(mainLine[currentTrough] > mainLine[lastTrough] && Low[currentTrough] < Low[lastTrough])

{

bullishDivergence[currentTrough] = mainLine[currentTrough] - arrowsDisplacement;

divergencesType[currentTrough] = 1; //"Classic Bullish";

divergencesStochasticsDiff[currentTrough] = MathAbs(mainLine[currentTrough] - mainLine[lastTrough]);

divergencesPriceDiff[currentTrough] = MathAbs(Low[currentTrough] - Low[lastTrough]);

if(drawPriceTrendLines == true)

DrawPriceTrendLine(Time[currentTrough], Time[lastTrough],

Low[currentTrough],

Low[lastTrough], Green, STYLE_SOLID);

if(drawIndicatorTrendLines == true)

DrawIndicatorTrendLine(Time[currentTrough],

Time[lastTrough],

mainLine[currentTrough],

mainLine[lastTrough],

Green, STYLE_SOLID);

if(displayAlert == true)

DisplayAlert("Classical Stochastics bullish divergence on: ", currentTrough);

}

}

//-----HIDDEN DIVERGENCE--//

if (DisplayHiddenDivergences == true)

{

if (mainLine[currentTrough] Low[lastTrough])

{

bullishDivergence[currentTrough] = mainLine[currentTrough] - arrowsDisplacement;

divergencesType[currentTrough] = 2; //"Hidden Bullish";

divergencesStochasticsDiff[currentTrough] = MathAbs(mainLine[currentTrough] - mainLine[lastTrough]);

divergencesPriceDiff[currentTrough] = MathAbs(Low[currentTrough] - Low[lastTrough]);

if(drawPriceTrendLines == true)

DrawPriceTrendLine(Time[currentTrough], Time[lastTrough],

Low[currentTrough],

Low[lastTrough], Green, STYLE_DOT);

if(drawIndicatorTrendLines == true)

DrawIndicatorTrendLine(Time[currentTrough],

Time[lastTrough],

mainLine[currentTrough],

mainLine[lastTrough],

Green, STYLE_DOT);

if(displayAlert == true)

DisplayAlert("Hidden Stochastics bullish divergence on: ", currentTrough);

}

}

}

void CatchBearishDivergence(int shift)

{

if(IsIndicatorPeak(shift) == false)

return;

int currentPeak = shift;

int lastPeak = GetIndicatorLastPeak(shift);

//-- CLASSIC DIVERGENCE --//

if (DisplayClassicalDivergences == true)

{

if(mainLine[currentPeak] High[lastPeak])

{

bearishDivergence[currentPeak] = mainLine[currentPeak] + arrowsDisplacement;

divergencesType[currentPeak] = 3; //"Classic Bearish";

divergencesStochasticsDiff[currentPeak] = MathAbs(mainLine[currentPeak] - mainLine[lastPeak]);

divergencesPriceDiff[currentPeak] = MathAbs(Low[currentPeak] - Low[lastPeak]);

if(drawPriceTrendLines == true)

DrawPriceTrendLine(Time[currentPeak], Time[lastPeak],

High[currentPeak],

High[lastPeak], Red, STYLE_SOLID);

if(drawIndicatorTrendLines == true)

DrawIndicatorTrendLine(Time[currentPeak], Time[lastPeak],

mainLine[currentPeak],

mainLine[lastPeak], Red, STYLE_SOLID);

if(displayAlert == true)

DisplayAlert("Classical Stochastics bearish divergence on: ", currentPeak);

}

}

//----HIDDEN DIVERGENCE----//

if (DisplayHiddenDivergences == true)

{

if(mainLine[currentPeak] > mainLine[lastPeak] && High[currentPeak] < High[lastPeak])

{

bearishDivergence[currentPeak] = mainLine[currentPeak] + arrowsDisplacement;

divergencesType[currentPeak] = 4;//"Hidden Bearish";

divergencesStochasticsDiff[currentPeak] = MathAbs(mainLine[currentPeak] - mainLine[lastPeak]);

divergencesPriceDiff[currentPeak] = MathAbs(Low[currentPeak] - Low[lastPeak]);

if(drawPriceTrendLines == true)

DrawPriceTrendLine(Time[currentPeak], Time[lastPeak],

High[currentPeak],

High[lastPeak], Red, STYLE_DOT);

if(drawIndicatorTrendLines == true)

DrawIndicatorTrendLine(Time[currentPeak], Time[lastPeak],

mainLine[currentPeak],

mainLine[lastPeak], Red, STYLE_DOT);

if(displayAlert == true)

DisplayAlert("Hidden Stochastics bearish divergence on: ", currentPeak);

}

}

}

bool IsIndicatorPeak(int shift)

{

if(mainLine[shift] >= mainLine[shift+1] && mainLine[shift] > mainLine[shift+2] && mainLine[shift] > mainLine[shift-1])

return(true);

else

return(false);

}

bool IsIndicatorTrough(int shift)

{

if(mainLine[shift] <= mainLine[shift+1] && mainLine[shift] < mainLine[shift+2] && mainLine[shift] < mainLine[shift-1])

return(true);

else

return(false);

}

int GetIndicatorLastPeak(int shift)

{

for(int i = shift + 5; i < Bars; i++)

{

if(mainLine >= mainLine && mainLine >= mainLine &&

mainLine >= mainLine && mainLine >= mainLine)

{

return(i);

}

}

return(-1);

}

int GetIndicatorLastTrough(int shift)

{

for(int i = shift + 5; i < Bars; i++)

{

if(mainLine <= mainLine && mainLine <= mainLine &&

mainLine <= mainLine && mainLine <= mainLine)

{

return(i);

}

}

return(-1);

}

void DisplayAlert(string message, int shift)

{

if(shift <= 2 && Time[shift] != lastAlertTime)

{

lastAlertTime = Time[shift];

Alert(message, Symbol(), " , ", Period(), " minutes chart");

}

}

void DrawPriceTrendLine(datetime x1, datetime x2, double y1, double y2, color lineColor, double style)

{

string label = "Stochastics_DivergenceLine_v1# " + DoubleToStr(x1, 0);

ObjectDelete(label);

ObjectCreate(label, OBJ_TREND, 0, x1, y1, x2, y2, 0, 0);

ObjectSet(label, OBJPROP_RAY, 0);

ObjectSet(label, OBJPROP_COLOR, lineColor);

ObjectSet(label, OBJPROP_STYLE, style);

}

void DrawIndicatorTrendLine(datetime x1, datetime x2, double y1, double y2, color lineColor, double style)

{

int indicatorWindow = WindowFind(indicatorName);

if(indicatorWindow < 0)

return;

string label = "Stochastics_DivergenceLine_v1$# " + DoubleToStr(x1, 0);

ObjectDelete(label);

ObjectCreate(label, OBJ_TREND, indicatorWindow, x1, y1, x2, y2, 0, 0);

ObjectSet(label, OBJPROP_RAY, 0);

ObjectSet(label, OBJPROP_COLOR, lineColor);

ObjectSet(label, OBJPROP_STYLE, style);

 
pipsintheair:
void CatchBullishDivergence(int shift)

{

if(IsIndicatorTrough(shift) == false)

return;

int currentTrough = shift;

int lastTrough = GetIndicatorLastTrough(shift);

//--CLASSIC DIVERGENCE--//

if (DisplayClassicalDivergences == true)

{

if(mainLine[currentTrough] > mainLine[lastTrough] && Low[currentTrough] < Low[lastTrough])

{

bullishDivergence[currentTrough] = mainLine[currentTrough] - arrowsDisplacement;

divergencesType[currentTrough] = 1; //"Classic Bullish";

divergencesStochasticsDiff[currentTrough] = MathAbs(mainLine[currentTrough] - mainLine[lastTrough]);

divergencesPriceDiff[currentTrough] = MathAbs(Low[currentTrough] - Low[lastTrough]);

if(drawPriceTrendLines == true)

DrawPriceTrendLine(Time[currentTrough], Time[lastTrough],

Low[currentTrough],

Low[lastTrough], Green, STYLE_SOLID);

if(drawIndicatorTrendLines == true)

DrawIndicatorTrendLine(Time[currentTrough],

Time[lastTrough],

mainLine[currentTrough],

mainLine[lastTrough],

Green, STYLE_SOLID);

if(displayAlert == true)

DisplayAlert("Classical Stochastics bullish divergence on: ", currentTrough);

}

}

//-----HIDDEN DIVERGENCE--//

if (DisplayHiddenDivergences == true)

{

if (mainLine[currentTrough] Low[lastTrough])

{

bullishDivergence[currentTrough] = mainLine[currentTrough] - arrowsDisplacement;

divergencesType[currentTrough] = 2; //"Hidden Bullish";

divergencesStochasticsDiff[currentTrough] = MathAbs(mainLine[currentTrough] - mainLine[lastTrough]);

divergencesPriceDiff[currentTrough] = MathAbs(Low[currentTrough] - Low[lastTrough]);

if(drawPriceTrendLines == true)

DrawPriceTrendLine(Time[currentTrough], Time[lastTrough],

Low[currentTrough],

Low[lastTrough], Green, STYLE_DOT);

if(drawIndicatorTrendLines == true)

DrawIndicatorTrendLine(Time[currentTrough],

Time[lastTrough],

mainLine[currentTrough],

mainLine[lastTrough],

Green, STYLE_DOT);

if(displayAlert == true)

DisplayAlert("Hidden Stochastics bullish divergence on: ", currentTrough);

}

}

}

void CatchBearishDivergence(int shift)

{

if(IsIndicatorPeak(shift) == false)

return;

int currentPeak = shift;

int lastPeak = GetIndicatorLastPeak(shift);

//-- CLASSIC DIVERGENCE --//

if (DisplayClassicalDivergences == true)

{

if(mainLine[currentPeak] High[lastPeak])

{

bearishDivergence[currentPeak] = mainLine[currentPeak] + arrowsDisplacement;

divergencesType[currentPeak] = 3; //"Classic Bearish";

divergencesStochasticsDiff[currentPeak] = MathAbs(mainLine[currentPeak] - mainLine[lastPeak]);

divergencesPriceDiff[currentPeak] = MathAbs(Low[currentPeak] - Low[lastPeak]);

if(drawPriceTrendLines == true)

DrawPriceTrendLine(Time[currentPeak], Time[lastPeak],

High[currentPeak],

High[lastPeak], Red, STYLE_SOLID);

if(drawIndicatorTrendLines == true)

DrawIndicatorTrendLine(Time[currentPeak], Time[lastPeak],

mainLine[currentPeak],

mainLine[lastPeak], Red, STYLE_SOLID);

if(displayAlert == true)

DisplayAlert("Classical Stochastics bearish divergence on: ", currentPeak);

}

}

//----HIDDEN DIVERGENCE----//

if (DisplayHiddenDivergences == true)

{

if(mainLine[currentPeak] > mainLine[lastPeak] && High[currentPeak] < High[lastPeak])

{

bearishDivergence[currentPeak] = mainLine[currentPeak] + arrowsDisplacement;

divergencesType[currentPeak] = 4;//"Hidden Bearish";

divergencesStochasticsDiff[currentPeak] = MathAbs(mainLine[currentPeak] - mainLine[lastPeak]);

divergencesPriceDiff[currentPeak] = MathAbs(Low[currentPeak] - Low[lastPeak]);

if(drawPriceTrendLines == true)

DrawPriceTrendLine(Time[currentPeak], Time[lastPeak],

High[currentPeak],

High[lastPeak], Red, STYLE_DOT);

if(drawIndicatorTrendLines == true)

DrawIndicatorTrendLine(Time[currentPeak], Time[lastPeak],

mainLine[currentPeak],

mainLine[lastPeak], Red, STYLE_DOT);

if(displayAlert == true)

DisplayAlert("Hidden Stochastics bearish divergence on: ", currentPeak);

}

}

}

bool IsIndicatorPeak(int shift)

{

if(mainLine[shift] >= mainLine[shift+1] && mainLine[shift] > mainLine[shift+2] && mainLine[shift] > mainLine[shift-1])

return(true);

else

return(false);

}

bool IsIndicatorTrough(int shift)

{

if(mainLine[shift] <= mainLine[shift+1] && mainLine[shift] < mainLine[shift+2] && mainLine[shift] < mainLine[shift-1])

return(true);

else

return(false);

}

int GetIndicatorLastPeak(int shift)

{

for(int i = shift + 5; i < Bars; i++)

{

if(mainLine >= mainLine && mainLine >= mainLine &&

mainLine >= mainLine && mainLine >= mainLine)

{

return(i);

}

}

return(-1);

}

int GetIndicatorLastTrough(int shift)

{

for(int i = shift + 5; i < Bars; i++)

{

if(mainLine <= mainLine && mainLine <= mainLine &&

mainLine <= mainLine && mainLine <= mainLine)

{

return(i);

}

}

return(-1);

}

void DisplayAlert(string message, int shift)

{

if(shift <= 2 && Time[shift] != lastAlertTime)

{

lastAlertTime = Time[shift];

Alert(message, Symbol(), " , ", Period(), " minutes chart");

}

}

void DrawPriceTrendLine(datetime x1, datetime x2, double y1, double y2, color lineColor, double style)

{

string label = "Stochastics_DivergenceLine_v1# " + DoubleToStr(x1, 0);

ObjectDelete(label);

ObjectCreate(label, OBJ_TREND, 0, x1, y1, x2, y2, 0, 0);

ObjectSet(label, OBJPROP_RAY, 0);

ObjectSet(label, OBJPROP_COLOR, lineColor);

ObjectSet(label, OBJPROP_STYLE, style);

}

void DrawIndicatorTrendLine(datetime x1, datetime x2, double y1, double y2, color lineColor, double style)

{

int indicatorWindow = WindowFind(indicatorName);

if(indicatorWindow < 0)

return;

string label = "Stochastics_DivergenceLine_v1$# " + DoubleToStr(x1, 0);

ObjectDelete(label);

ObjectCreate(label, OBJ_TREND, indicatorWindow, x1, y1, x2, y2, 0, 0);

ObjectSet(label, OBJPROP_RAY, 0);

ObjectSet(label, OBJPROP_COLOR, lineColor);

ObjectSet(label, OBJPROP_STYLE, style);

That is just the part of the indicator

If it does not work, how can we know if the error is not somewhere else?

 

can someone add alerts to this, I know there are other adx crosses with alerts but I want this one. adxcrosses.mq4

Files: