Help on ADX EA to open a position

 

Hi, I try to follow some examples but I was not able to make my EA to open a buy position

I dont now what happen, if someone could help me.


The Idea is open a position if the+DI is higher than 25 and -DI lower than 20


Thanks for any help

Files:
Teste_ADX.mq5  8 kb
 
Nórton Barth:

 I was not able to make my EA to open a buy position

This function may help
https://www.mql5.com/en/docs/standardlibrary/tradeclasses/ctrade/ctradepositionopen
 
Anthony Garot:
This function may help
https://www.mql5.com/en/docs/standardlibrary/tradeclasses/ctrade/ctradepositionopen

Thanks Anthony for the hint, but the ADX is no compatible with CTrade (I discover just now )

 
Nórton Barth: Thanks Anthony for the hint, but the ADX is no compatible with CTrade (I discover just now )

And why would ADX and "CTrade" not be compatible?

ADX is an indicator like any other and "CTrade" is a class for handling trade operations, which is a completely different scope!

Reason: