requestS.type =ORDER_TYPE_SELL; requestS.price =SymbolInfoDouble(_Symbol,SYMBOL_BID); requestS.tp =SymbolInfoDouble(_Symbol,SYMBOL_BID)-100*_Point; requestS.sl =SymbolInfoDouble(_Symbol,SYMBOL_BID)+100*_Point;
TP must be below price for this order type (and SL above.)
And it is recommended to use the current tick to get bid and ask:
MqlTick tick; if(!SymbolInfoTick(_Symbol,tick)) { Print("SymbolInfoTick failed, error = ",GetLastError()); ExpertRemove(); return; } double AskPrice=tick.ask; double BidPrice=tick.bid;
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
Im having problems with this code switching to engaging in different trade orders, so specifically these lines
I thought that if written like this when the first if statement is true then it would go through with the localized order which it does but the issue is with the second order which is when th if statement is true but the order doesn't go so and i hae fiddled wit hit a lot and the issue to me seems to be MqlTrade and i was wondering how to write this so it works,
Thank you