Download MetaTrader 5
To add comments, please log in or register
Do you have questions on how to turn your idea into reality? Ask them on the Forum!
Icham Aidibe
9891
Icham Aidibe 2015.07.21 09:32 

Hi !

Using CTrade. Strategy Tester.

Trade.PositionModify(_Symbol,sl,0);

returns

2013.05.21 23:59:00   CTrade::OrderSend: modify EURUSD (sl: 1.28620, tp: 0.00000) [invalid stops]
2013.05.21 23:59:00   failed modify sell 0.22 EURUSD sl: 0.00000, tp: 0.00000 -> sl: 1.28620, tp: 0.00000 [Invalid stops]

(look at the date)


Strategy Tester run from 21.05.2013 before the deal taken

No error

How's that possible ?! I've seek on the forum with no clear solution & now send a copy to the service desk. May you share your experience & workarounds about please ? 

NB : somes says putting a Sleep(5) before the position modify make the trick but didn't worked for me ...

NB 2 : Not seen live session.

Alain Verleyen
Moderator
29467
Alain Verleyen 2015.07.23 00:46  
Icham Aidibe:

Hi !

Using CTrade. Strategy Tester.

returns


Strategy Tester run from 21.05.2013 before the deal taken

How's that possible ?! I've seek on the forum with no clear solution & now send a copy to the service desk. May you share your experience & workarounds about please ? 

What was the market price at the time you tried to modify your SL ? You need to take into account stopslevel.

You can also have to normalize your sl price, depending on how it's set.

NB : somes says putting a Sleep(5) before the position modify make the trick but didn't worked for me ...

Of course, that doesn't make sense.
Icham Aidibe
9891
Icham Aidibe 2015.07.23 07:38  
Alain Verleyen:

What was the market price at the time you tried to modify your SL ? You need to take into account stopslevel.

You can also have to normalize your sl price, depending on how it's set.

Of course, that doesn't make sense.

All of course good about price l'AngeVoyageur. Including the stop level & the swap.

Alain Verleyen
Moderator
29467
Alain Verleyen 2015.07.23 21:44  
Icham Aidibe:

All of course good about price l'AngeVoyageur. Including the stop level & the swap.

Of course, all is good but you get an error.
Icham Aidibe
9891
Icham Aidibe 2015.07.23 22:30  
Alain Verleyen:
Of course, all is good but you get an error.

A error that appears only when the tester runs on a long history. May be due to memory ?

Alain Verleyen
Moderator
29467
Alain Verleyen 2015.07.23 22:39  
Icham Aidibe:

A error that appears only when the tester runs on a long history. May be due to memory ?

There is no way to help if you don't give all informations.
Icham Aidibe
9891
Icham Aidibe 2015.07.24 03:46  
Alain Verleyen:
There is no way to help if you don't give all informations.

There are all the informations & the complete log. Trade.Modify ---> error invalidstop ---> printf(_LastError) ---> error 4756 on full history test & not if started few days before the error occurs.

Everything's there Alain.

/
To add comments, please log in or register