Invalid stops message when modifying orders

 

Hi guys,

 

I've got an expert advisor creating orders with:

request.action= TRADE_ACTION_PENDING;

I later modify those pending orders using:

request.action= TRADE_ACTION_MODIFY;

for some reason I keep getting messages like this:

2012.10.01 01:15:55 Trades '517505': order #2345441 buy stop 0.10 / 0.10 EURUSD at 1.28128 placed

2012.10.01 01:15:56 Trades '517505': failed modify order #2345441 buy stop 0.10 EURUSD at 1.28128 sl: 1.28098 tp: 1.28598 -> 1.28112, sl: 1.28082 tp: 1.28582 [Invalid stops]
Thanks in advance!
 
I figured out this doesn't happen on MetaQuotes Demo account, only on ActivTrades Demo Account!
Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Account Properties
Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Account Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Environment State / Account Properties - Documentation on MQL5
 

Maybe ActiveTrades stoplevel is higher than MetaQuotes stoplevel. 

 

 
Even if im using sl and tp about 1ctfrom the price this is happening
 
martinm:

Hi guys,

 

I've got an expert advisor creating orders with:

Look at the code of this guy: https://www.mql5.com/en/articles/442 

He modifies his orders in order to set the  trailing stops (request.action=TRADE_ACTION_SLTP;)... the system works well.

I tried to modify the code for my own EAs, but Im having the same errors you are experiencing... :(

Money-Making Algorithms Employing Trailing Stop
Money-Making Algorithms Employing Trailing Stop
  • 2012.07.16
  • Гребенев Вячеслав
  • www.mql5.com
This article's objective is to study profitability of algorithms with different entries into trades and exits using trailing stop. Entry types to be used are random entry and reverse entry. Stop orders to be used are trailing stop and trailing take. The article demonstrates money-making algorithms with a profitability of about 30% per annum.
Reason: