I need Help Please

 

Hello;

I have this indicator but it's not with Alert.

I need to but for it Alert and Signal how can I do it please.

#property indicator_chart_window

#property indicator_buffers 2

#property indicator_color1 Blue

#property indicator_color2 Red

double CrossUp[];

double CrossDown[];

extern int FasterWMA = 5;

extern int SlowerSMA = 8;

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

//| Custom indicator initialization function |

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

int init()

{

//---- indicators

SetIndexStyle(0, DRAW_ARROW, EMPTY);

SetIndexArrow(0, 233);

SetIndexBuffer(0, CrossUp);

SetIndexStyle(1, DRAW_ARROW, EMPTY);

SetIndexArrow(1, 234);

SetIndexBuffer(1, CrossDown);

//----

return(0);

}

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

//| Custom indicator deinitialization function |

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

int deinit()

{

//----

//----

return(0);

}

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

//| Custom indicator iteration function |

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

int start() {

int limit, i, counter;

double fasterWMAnow, slowerSMAnow, fasterWMAprevious, slowerSMAprevious, fasterWMAafter, slowerSMAafter;

double Range, AvgRange;

int counted_bars=IndicatorCounted();

//---- check for possible errors

if(counted_bars<0) return(-1);

//---- last counted bar will be recounted

if(counted_bars>0) counted_bars--;

limit=Bars-counted_bars;

for(i = 0; i <= limit; i++) {

counter=i;

Range=0;

AvgRange=0;

for (counter=i ;counter<=i+9;counter++)

{

AvgRange=AvgRange+MathAbs(High[counter]-Low[counter]);

}

Range=AvgRange/10;

fasterWMAnow = iMA(NULL, 0, FasterWMA, 0, MODE_LWMA, PRICE_CLOSE, i);

fasterWMAprevious = iMA(NULL, 0, FasterWMA, 0, MODE_LWMA, PRICE_CLOSE, i+1);

fasterWMAafter = iMA(NULL, 0, FasterWMA, 0, MODE_LWMA, PRICE_CLOSE, i-1);

slowerSMAnow = iMA(NULL, 0, SlowerSMA, 0, MODE_SMA, PRICE_CLOSE, i);

slowerSMAprevious = iMA(NULL, 0, SlowerSMA, 0, MODE_SMA, PRICE_CLOSE, i+1);

slowerSMAafter = iMA(NULL, 0, SlowerSMA, 0, MODE_SMA, PRICE_CLOSE, i-1);

if ((fasterWMAnow > slowerSMAnow) && (fasterWMAprevious slowerSMAafter)) {

CrossUp = Low - Range*0.5;

}

else if ((fasterWMAnow slowerSMAprevious) && (fasterWMAafter < slowerSMAafter)) {

CrossDown = High + Range*0.5;

}

}

return(0);

}

 

Check those 2 threads:

https://www.mql5.com/en/forum/general

https://www.mql5.com/en/forum/173235

It should be many ma indicators with alert.

 
BigLover:
Hello;

I have this indicator but it's not with Alert.

I need to but for it Alert and Signal how can I do it please.

Hi BigLover,

Thanks for your PM.

I understand the following:

- you really need it;

- you can not set already existing indicators for yourself.

I have no idea which timeframe you are using and why LWMA5 crossing SMA8 may be profitable for you. Seems you are using some trading system. Because LWMA5 crossing SMA8 can not be profitable by itself.

I modified indicator of Kalenzo 100 times already.

It is wma indicator.

Why wma?

because we (I and Kalenzo started some thread about wma trading long time ago (it was good system).

Please find indicator which I changed for you.

Settings:

- UseSound = False; (just sound on crossing).

- TypeChart = False; (it does not work, hope somebody will fix it - it types crosses for the open bar on the chart).

- UseAlert = False; (it works; but it is not "alert once").

- ShortPeriod = 5; (period of your lwma).

- ShortPeriodMode = 3; (3 = lwma; look inside the code for more information about ema, sma and so on).

- BigPeriod = 8; (period of your sma).

- BigPeriodMode = 0; //0=sma, 1=ema, 2=smma, 3=lwma (i think you understand that it is explanation of the settings inside the coe - MetaEditor).

- DeltaForSell = 0; (it is delta for sell: if one ma indicator is crossing the other one so will you really believe that it is real sell? Of course not; so it is the channel in pips for sell; it is crossing point + some pips; just for alarm/alert/arrows);

- DeltaForBuy = 0; (the same with previous one but for buy signals).

Files:
 

I really no idea why you need LWMA5/SMA8 crossing.

Simple crossing will not work.

Look at the image.

may be, you are using some other indicators as well ...

Files:
 

Well.

But the sitruation is not so bad.

because we have some delta.

What is delta?

It is some settings with indicator. When one ma type of indicator is crossing the othjer ma type. But it is nothing for us. because one ma indicator is crossing the other one very often. We will consider it as trading signal if one ma indicator is crossing the other ma type of indicator + some pips. he same with MA channel.

Look at the image with Delta=4.

Files:
 

Well.

It is for sell for exmaple:

else if( pwma5 >= pwma50 && cwma5 < (cwma50 - (DeltaForSell*Point)))

It means that small ma should be crossed sme big ma indicator and it is fine. On the close bar. But one bar ago it should be the following: small ma should be below big ma + delta. It means more below. Below + delta.

 

Just want to remind that we are talking about one indicator only (posted above). Not about trading system.

 

It was the other idea to use RSI to filter some other signals (together with delta of course). And it may be coded in one indicator as well.

Reason: