Need Help in using the DeMark line indicator in an EA

 

I'm quite new in trading and EA development as such. At the moment I'm trying to use a DeMark lines indicator as a trading criteria in my EA. My challenge is, the output from the indicator is visual objects (DeMark trend lines ) plotted on the screen. How do I call this objects by referencing the custom indicator within my EA? I have tried using the buffer index (i.e. iCustom(NULL,............,1,0) and (.............0,0)) but didn't seems to work.


Thanking you in advance.

 

The arrows are available as index buffers.

The lines are objects, as you noted.

for(int i = ObjectsTotal() -1; i >= 0; i--)

{

string name = ObjectName(i);

... decide if the name of the object starts with one of the demark objects names -- if(StringFind(name, ...) == 0){

... and perform further object queries -- ObjectGet(name, ..., ...) -- to find the properties you are interested in...

}

 
phy:

The arrows are available as index buffers.

The lines are objects, as you noted.

for(int i = ObjectsTotal() -1; i >= 0; i--)

{

string name = ObjectName(i);

... decide if the name of the object starts with one of the demark objects names -- if(StringFind(name, ...) == 0){

... and perform further object queries -- ObjectGet(name, ..., ...) -- to find the properties you are interested in...

}

 

Thanks a lot. I will try your suggestion out.

 
syr803gauteng:


 

Hi Phy. Since your last suggestions I have updated my code accordingly and it compiled successfully. Unfortunately when, I ran it on the strategy tester, it still doesn't open/close orders as I would like it to do. Can you please check the attached code and see if you might see where I could be going wrong?

Files:
demark_v1.mq4  13 kb
 
I just tried this EA and it opens a buy order but I don't know if it will close since you have not included the rest of the indicators in the EA.
 
Why are you replying to a five year old post?
Reason: