Greg_:
Do you check that the OrderSend() worked ? how does CheckForClose() work when you first start the EA before OrderSend() has been called and while resSL is still at it's default of zero ? is resSL a locally declared variable or globally declared ? if the pending order is activated you can't delete it you have to close it, how do you check it isn't activated yet ?
Hello,
Probably a noob question but couldn't find and answer browsing the forum. I basicly have this setup :
But it looks like that resSL = 0 (using the print(resSL) ) and it cannot delete the order...
What is wrong ?
- Did you check the open worked? What are Function return values ? How do I use them ? - MQL4 forum
- resSL = 0You didn't save the ticket number you opened in a globally declared variable, or didn't find the pending order in a orderSelect loop.
- You declared resSL in CheckForClose() thus hiding the global
Thanks for your quick answer. Yes the OrderSend worked fine, it is just the closing.
Maybe it's a variable thing... I did declare "int resSL;" on the top of the code and also in both CheckForOpen() and CheckForClose().... Maybe i only need to declare it on the top of the code ?
That might be the issue as indicated in your point 3. WHRoeder :)
Thanks!!
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
Hello,
Probably a noob question but couldn't find and answer browsing the forum. I basicly have this setup :
But it looks like that resSL = 0 (using the print(resSL) ) and it cannot delete the order...
What is wrong ?
Thanks!
Greg