I have not looked closely at your code, but I see that it is an indicator.
An indicator cannot open, modify or close trades so you will need to rewrite your code as an EA.
GumRai:
I have not looked closely at your code, but I see that it is an indicator.
An indicator cannot open, modify or close trades so you will need to rewrite your code as an EA.
Hi GumRai
That'll be it then.. Now I'm venturing into unknown territory again
Thanks for the reply
Phil
Just to let you know that it's all working now
Thanks for your pointer :)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi
I have the code below, that is a portion of code extracted from my project, which according to other examples I've read as well as the MQL4 documentation I've read, should work without a problem. I have alerts in amongst the code to inform me what is happening & the code appears to be working as it should. That is with the exception of the OrderClose function.
I have buttons on screen with the same name as the ticket number of the trade & I'm trying to close the trade with that ticket number by comparing the return of the button name (sparam) and the OrderTicket() number. That part is working, the testing of a Buy or Sell trade works, the OrderClose is not playing fair. The code isn't the finished article, it's a work in progress.
Debugging MQL4 is a nightmare compared to VBA.
Can anyone see why it's not working please?
Thanks