open orders on start

 

Hi all,

 I come across  with an issue;

When I put the ea for the first time an order is opened, then when that order closes the next one opens normally, meaning that the ea waits for price goes up or down the OpenLevel

What I expect the ea to do is from the very beginning it should wait until the price goes up or down and when it reaches the OpenLevel an order should  open.

Any help on this?

 

Thank you in advance

 

Luis 

Files:
trend_v7.mq4  11 kb
 
luisneves: What I expect the ea to do is from the very beginning it should wait until the price goes up or down and when it reaches the OpenLevel an order should  open.
Print your variables before your if statements find find out why.
Reason: