Error fix help

 

Hello all,

I've been coding for a few weeks now and i am a BIG novice in it. I tried using GlobalVariableGet() to try and code the i panel trend indicator into my EA but i think i messed up some where but i can't seem to find out where. For the reversal fractals, i've written the codes and it shows when i backtest but it takes no reading unless i change the EMPTY_VALUE to 0 and even then, it always opens both the buy and sell. Finally, my EA opens both the buy and sell order for every indicator even after specifying conditions. I've tried looking for where i've gone wrong but i can't seem to find it. Can someone please help?

I've attached the code for review.


Thanks so much in advance.

Files:
MyEA2.mq4  30 kb
 

Hello once again,

I'm a bit sad that no one decided to assist me. Anyway, i've fixed most of the errors. I have one problem left, how can i deal with closing orders using signal reversal? For some reason, the closeorder function closes too late.


P.S. Contrary to what i've been reading in the internet, i think my code fixed the way to only open one order per bar. Also, you only need to read the top half of my code, the first segment. The part after the ontick(). It also contains the fix.

In addition, I've played with several ideas here so feel free to use them.

Thanks in advance for the help.

Files:
MyEA2.mq4  31 kb
Reason: