1.) RefreshRates()
2.) MarketInfo ( OrderSymbol(), MODE_FREEZELEVEL )
3) There exists TradeSemaphore() in the EA's?
4) Optional: Bid = OrderClosePrice()
5) Optional : separate if ( ! OrderSelect(... or if ( Ord..
better approach is :
if ( ! OrderSelect(...) ) continue; if ( conditions == true ) ClTickets[n] = OrderTicket();// orderTicket is stored for later n++; // in same task, or another can because tickets are known // if ( OrderSelect( ClTickets[n-1.. // .. proceed OrderClose(ClTickets[n-1...
thanks! works just fine now - I made some changes and also incorporated your suggestion to separate ifs and use the "if (!...) continue" instead - I havent really used that before but looks solid. many 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 boys,
So my setup is as follows: one chart (with its own EA) is opening the primary order, while a second EA runs on another chart (same symbol) - for hedging and other purposes. The bit below is part of the secondary (hedging) chart and EA, and tries to close the primary order in the hedging EA based on "some conditions"....
I already checked that the conditions provide the correct trigger (ie, I got it to print a message etc), however the order in the primary chart is not closing. What can be wrong with it?? I also checked for circularity of logic, as some of the conditions go back and forth between the two EAs (it seems OK, and compilation returns no errors, but will check again if you think that may cause it..)
Thanks in advance for your insights!
Dan (scratching my head..)