Indicators: Slope Direction Line

 

Slope Direction Line:

The Slope Direction Line trend indicator, used by the Hammering EA from the Market section.

Author: IURII TOKMAN

 

Hi

Nice job.

I'm new in MQL programming.

How can I use this indicator in an EA?


The code below is correct?

extern int period=32;
extern int method=3; // MODE_SMA
extern int price=0; // PRICE_CLOSE

double Up = iCustom( NULL, 0, "Slope Direction Line", period, method, price, 0, 0 ); // BUFFER 0 - Blue

double Dn = iCustom( NULL, 0, "Slope Direction Line", period, method, price, 1, 0 ); // BUFFER 1 - Red


if(Up<Dn) return(1);      // Slope Direction Blue

 if(Up>Dn) return(2);      // Slope Direction Red


Thak you.

Rogério

 

Can anyone please add an alert to this indicator? I would really appreciate it! :)

Thanks!! 

 
49ers80:

Can anyone please add an alert to this indicator? I would really appreciate it! :)

Thanks!! 

Hi

ok! 

 
Thanks Iurii! 
 
49ers80:
Thanks Iurii! 

you are welcome !

I need time.....

 
Iurii Tokman:

you are welcome !

I need time.....


Still looking for an alert on this indicator, would really help me out. thanks
 

I'm  trying to use this indicator in my EA but B1 and B2 arrays act weird sometimes. As I look into the code, I notice B2 is for (buy) blue lines and B1 is for (sell) red lines. So whenever the value in B2 == EMPTY_VALUE the graph shows red and vice versa. 

There's a case when the B2 is filled with a value which means (B1[i]>B1[i+1]) but the graph still shows the red line and my EA goes into a long trade because it thinks the graph changed to blue but visually it actually didn't.

Anyone to the rescue? The author maybe? :) 

 
gurel kaynak:

use the broken line

Reason: