Download MetaTrader 5
To add comments, please log in or register
How to buy a product in MetaTrader AppStore? Read the article!
steveh
10
steveh 2014.11.29 13:51 

Hi,

 

In my trading I use the attached indicator to create an alert when Stochastic is overbought or oversold using the 80 and 20 limits.

I really want to only get these alerts when the standard ADX indicator (the one included with MetaTrader) is less than 25.

Can anyone please help with this? 

I think that if the attached stochastic code was wrapped in some kind of IF, then, else statement (maybe!) according to the value of ADX then this would work. (If ADX < 25 then fire stochastic alert else do nothing.) 

I am not too familiar with MQL 4 so not 100% sure how to do this.

If anyone could edit the attached code and repost that would be very handy. 

 

Thanks! 

 

p.s. Also this is my first post so apologies if this is in the wrong place. 

Files:
Ernst Van Der Merwe
4404
Ernst Van Der Merwe 2014.12.01 08:33  
steveh2015:

Hi,

 

In my trading I use the attached indicator to create an alert when Stochastic is overbought or oversold using the 80 and 20 limits.

I really want to only get these alerts when the standard ADX indicator (the one included with MetaTrader) is less than 25.

Can anyone please help with this? 

I think that if the attached stochastic code was wrapped in some kind of IF, then, else statement (maybe!) according to the value of ADX then this would work. (If ADX < 25 then fire stochastic alert else do nothing.) 

I am not too familiar with MQL 4 so not 100% sure how to do this.

If anyone could edit the attached code and repost that would be very handy. 

 

Thanks! 

 

p.s. Also this is my first post so apologies if this is in the wrong place. 

Add this function to the code and change the four expressions accordingly.

bool adx()
  {
   double adx = iADX(_Symbol,_Period,14,PRICE_CLOSE,MODE_MAIN,0);
   if(adx<25)  return(true);
   return(false);
  }
  
if (Enable_Alert_1 && adx() && v1[0] >= Overbuy_Level && OBOS != 1)
whroeder1
13627
whroeder1 2014.12.01 13:27  
 if(adx<25)  return(true);
   return(false);
return (adx<25);
/
To add comments, please log in or register