iCustom in an EA

 

Hello everyone out there,

i have been trying to put in demark trend lines as a custom idicator in my EA.

But i wont get it to work.

This is the Custom idicator https://www.mql5.com/en/code/8296

In the indicator the IndexBuffer looks like this

SetIndexBuffer(1,ExtMapBuffer2);

SetIndexBuffer(0,ExtMapBuffer1);

I want the EA to :

Open Buy pos when iLow is lower or equal to the low trendline

Open Sell pos when iHigh is higer or equal to the high trendline

And i think the iCutom in my EA should look like this.??? Or am i doing wrong..??

double Buy1_1 = iCustom(NULL, 0, "DeMark Trendline Trader", STYLE_DOT, 2, STYLE_SOLID, 3, 1, Current + 0);
double Buy1_2 = iLow(NULL, 0, Current + 0);


double Sell1_1 = iCustom(NULL, 0, "DeMark Trendline Trader", STYLE_DOT, 2, STYLE_SOLID, 3, 0, Current + 0);
double Sell1_2 = iHigh(NULL, 0, Current + 0);


if (Buy1_1 >= Buy1_2) Order = SIGNAL_BUY;
if (Sell1_1 <= Sell1_2) Order = SIGNAL_SELL;

Is there anyone that could help me solve this problem??

Thanks // Pontus

 
That Indicator has 13 extern variables . . . you need to pass none of them or ALL of them . . . you can't pick and choose which to pass because the Indicator has no way of knowing which you have and haven't passed.
 
RaptorUK:
That Indicator has 13 extern variables . . . you need to pass none of them or ALL of them . . . you can't pick and choose which to pass because the Indicator has no way of knowing which you have and haven't passed.


Thanks Raptor =)!

 

Another question the Index buffer number in the demark idicator linked https://www.mql5.com/en/code/8296

Is

For lower line 2 ?

For Higher line 3?

double Buy1_1 = iCustom(NULL, 0, "DeMark Trendline Trader", 2, Current + 0);


double Sell1_1 = iCustom(NULL, 0, "DeMark Trendline Trader", 3, Current + 0);

Or am i wrong.?

 
pontuso:

Another question the Index buffer number in the demark idicator linked https://www.mql5.com/en/code/8296

Is

For lower line 2 ?

For Higher line 3?

Or am i wrong.?

Easiest way to find out is to put the indicator on a chart and investigate it using the Data Window (Ctrl + D).
 

Ok thanks a lot, i will try that.

Cheers!

Reason: