Indicators with alerts/signal - page 433

 
cwu:
Hi mrtools,

Thanks so much, you're the best. Is the option "OldCalculation" what you mentioned with repainting from old version? If I turn it to true, it will go back to the old indicator's repaint method?

Can you put in an option to turn on/off the MA filter? Thanks!

I tested the MA filter but for example, when prices are below MA, there is still a buy alert.

 
cwu:
I tested the MA filter but for example, when prices are below MA, there is still a buy alert.

Will try to answer both questions the old calculation was using atr the new calculation uses high and low plus and minus updown shift that changes depending on your timeframe. It has nothing to do with the repainting that was going on before,you can try any settings and it won't repaint after a closed bar.

I coded the alerts to go when price breaks the super trend, that was the way i understood your request, and I can add code to add or remove the ma, but want to make sure how you want the alerts.

 
mrtools:
Will try to answer both questions the old calculation was using atr the new calculation uses high and low plus and minus updown shift that changes depending on your timeframe. It has nothing to do with the repainting that was going on before,you can try any settings and it won't repaint after a closed bar. I coded the alerts to go when price breaks the super trend, that was the way i understood your request, and I can add code to add or remove the ma, but want to make sure how you want the alerts.

Hi mrtools,

You correctly coded the alerts when price breaks the super trend. The MA filter is just an option to turn on or off when prices are above/below the MA when alert is suppose to go off. So for example if the MA filter is turned on, a buy alert will only go off when price is above the MA, etc. If MA filter is turned off, all alerts will go off regardless of price in relations to MA. Thanks again.

 
cwu:
Hi mrtools, You correctly coded the alerts when price breaks the super trend. The MA filter is just an option to turn on or off when prices are above/below the MA when alert is suppose to go off. So for example if the MA filter is turned on, a buy alert will only go off when price is above the MA, etc. If MA filter is turned off, all alerts will go off regardless of price in relations to MA. Thanks again.

Hi Cwu,

Think this one got it.

Files:
 
mrtools:
Hi Cwu, Think this one got it.

Thanks again mrtools!

 
dasio:
Hi it is possible to add sound alarm only when the arrow appear?

Thank you.

Sorry i can't attach it. I past the code here.

//+------------------------------------------------------------------+

//| KI_signals_v1.mq4 |

//| Kalenzo |

//| bartlomiej.gorski@gmail.com |

//+------------------------------------------------------------------+

#property copyright "Kalenzo"

#property link "bartlomiej.gorski@gmail.com"

#property indicator_chart_window

#property indicator_buffers 8

#property indicator_color1 AliceBlue

#property indicator_color2 AliceBlue

#property indicator_color3 DarkViolet

#property indicator_color4 DarkViolet

#property indicator_level1 0

extern int Length1 = 3;

extern int Length2 = 10;

extern int Length3 = 18;

// 60[min] = PERIOD_H1

int period = 60;

double Histo[];

double MaHisto[];

double Histoh1[];

double MaHistoh1[];

double up[];

double dn[];

double uph1[];

double dnh1[];

//+------------------------------------------------------------------+

//| Custom indicator initialization function |

//+------------------------------------------------------------------+

int init()

{

//---- additional buffers are used for counting

IndicatorBuffers(8);

SetIndexStyle(0,DRAW_ARROW,EMPTY,1);

SetIndexStyle(1,DRAW_ARROW,EMPTY,1);

SetIndexStyle(2,DRAW_ARROW,EMPTY,1);

SetIndexStyle(3,DRAW_ARROW,EMPTY,1);

SetIndexArrow(0,241);

SetIndexArrow(1,242);

SetIndexArrow(2,241);

SetIndexArrow(3,242);

// IndicatorDigits(6);

SetIndexBuffer(0,up);

SetIndexBuffer(1,dn);

SetIndexBuffer(2,uph1);

SetIndexBuffer(3,dnh1);

SetIndexBuffer(4,Histoh1);

SetIndexBuffer(5,MaHistoh1);

SetIndexBuffer(6,Histo);

SetIndexBuffer(7,MaHisto);

// IndicatorShortName("KI signals v1");

return(0);

}

int start()

{

int limit;

int counted_bars;// = IndicatorCounted();

int tmp, i, j, m;

// this is fro M30 (we are on it), but we want for H1

counted_bars = IndicatorCounted();

if(counted_bars<0) counted_bars=0;

if(counted_bars>0) counted_bars--;

// ----------- H1

// this is for H1, but counted_bars is for M30

// so...

limit = (Bars-counted_bars)/(period/Period()) + 1;

// limit=iBars(Symbol(),period)-1;//counted_bars;

for (i = 0 ;i <= limit ;i++)Histoh1 = iMA(Symbol(),period,Length1,0,MODE_EMA,PRICE_CLOSE,i) - iMA(Symbol(),period,Length2,0,MODE_EMA,PRICE_CLOSE,i);

for (j = 0 ;j <= limit ;j++)MaHistoh1[j] = iMAOnArray(Histoh1,0,Length3,0,MODE_EMA,j);

for (m = 0 ;m <= limit ;m++)

{

if(MaHistoh1[m+1] 0)

{

tmp = iTime (Symbol(),period,m);

for (j = 0; j < Bars; j++)

{

if (iTime(Symbol(),0,j) == tmp)

uph1[j-period/Period()+1] = iOpen(Symbol(),period,m)-(20*Point);

}

}

if(MaHistoh1[m+1] >= 0 && MaHistoh1[m]<0)

{

tmp = iTime (Symbol(),period,m);

for (j = 0; j < Bars; j++)

{

if (iTime(Symbol(),0,j) == tmp)

dnh1[j-period/Period()+1] = iOpen(Symbol(),period,m)+(20*Point);

}

}

}

// ----------- M30

counted_bars = IndicatorCounted();

if(counted_bars<0) counted_bars=0;

if(counted_bars>0) counted_bars--;

limit=Bars-counted_bars;

for (i = 0 ;i <= limit ;i++)Histo = iMA(Symbol(),0,Length1,0,MODE_EMA,PRICE_CLOSE,i) - iMA(Symbol(),0,Length2,0,MODE_EMA,PRICE_CLOSE,i);

for (j = 0 ;j <= limit ;j++)MaHisto[j] = iMAOnArray(Histo,0,Length3,0,MODE_EMA,j);

for (m = 0 ;m <= limit ;m++)

{

if(MaHisto[m+1] 0)

{

for (i = m+1; i < limit; i++)

{

if (uph1 != dnh1)

{

if (uph1 < dnh1)

up[m] = iOpen(Symbol(),0,m)-(20*Point);

else

break;

}

}

}

if(MaHisto[m+1] >= 0 && MaHisto[m]<0)

{

for (i = m+1; i < limit; i++)

{

if (uph1 != dnh1)

{

if (uph1 > dnh1)

dn[m] = iOpen(Symbol(),0,m)+(20*Point);

else

break;

}

}

}

}

return(0);

}

//+------------------------------------------------------------------+

Some help?? Thank you

 

Nmazz

erdenmensch:
Hi,

please can someone add an sound and window alert when the line is changing the position? Maybe with e-mail-alert, too?

This would be really nice. Its a top indicator.

HI

looks good, I have put 3 different deeps on 1 chart and it gives a better picture of the market structure. But it is difficult to show the 3 lines which are necessarily parly one above the other. It would be helpful if it were possible to change to other stylse of the lines f.i. dots etc!

Have a look at the screenshot.

Reagrds Wolfsch

Files:
 

Dear mrtools

It is possible to modify an indicator,if we have only the ex.4 file

but we don't have the mql.4?

Best regards

Dan

 
dansmol:
Dear mrtools

It is possible to modify an indicator,if we have only the ex.4 file

but we don't have the mql.4?

Best regards

Dan

Hi Dan,

No not possible to modify an ex.4 file.

 
dansmol:
Dear mrtools

It is possible to modify an indicator,if we have only the ex.4 file

but we don't have the mql.4?

Best regards

Dan

Dan. You can decompile it or have someone who has a updated decompiler to decompile it for you.

But you have to keep in mind that most coders won't

Work on a decompiled indi .

Ish

Reason: