-
bool orderms=OrderModify(OrderTicket(),OrderOpenPrice(),Ask+100*Point,OrderTakeProfit(),0,clrYellow);
Check your return codes, and report your errors (including market prices and your variables). Don't look at GLE/LE unless you have an error. Don't just silence the compiler (strict), it is trying to help you.
What are Function return values ? How do I use them ? - MQL4 programming forum 2012.05.20
Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles 25 March 2014 -
if(OrderStopLoss()>(Ask+100*Point))
Your initial sell SL is zero (none) so your if will never be true. Add ||OrderStopLoss()==0 or set a SL on the OrderSend.
-
Check your return codes, and report your errors (including market prices and your variables). Don't look at GLE/LE unless you have an error. Don't just silence the compiler (strict), it is trying to help you.
What are Function return values ? How do I use them ? - MQL4 programming forum 2012.05.20
Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles 25 March 2014 - Your initial sell SL is zero (none) so your if will never be true. Add ||OrderStopLoss()==0 or set a SL on the OrderSend.
Thanks a lot ||OrderStopLoss()==0 works here
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi, Everyone,
I'm getting error whenever I'm starting Strategy Tester. The problem is that Trailing stop works on Buy signals but it does not work on Sell signals. When I place TP and SL in sell OrderSend code everything is fine and automated system works. But I want to activate Trailing stop on it.
I deactivated buy OrderSend and run the code just for Sell and received this error:
TestGenerator: unmatched data error (volume limit 1164 at 2011.03.30 22:00 exceeded)
Here is my Trailing stop code
Thanks in advance