Value for stop lost

 

Hello


I got some issues setting my Sl value.

Here what i use, for the EURUSD pair :

 

double sl = 0.0004;
for a buy : Ask - (Ask * sl)
for a sell : Bid + (Bid * sl)

 

but i always have a 130 error, any idea why ?

 

thanks

Nicolas 

 
Here use the Documentation. Also from the Book.
 

Thanks for the Book ! but i still have the issue


Print ("Ask=" , Ask , "   -   Bid=" , Bid , "   - SL=" , (Ask - (Ask * sl)) , "   - Bid-sl=" , Bid - ((Ask - (Ask * sl))) , "   - StopLevel=" , stopLevel );
ticket = OrderSend(Symbol(),OP_BUY , 0.01 , Ask , 3 , (Ask - (Ask * sl)) , 0 , "EURUSD - buy - rsi 30" , 0 , 0 , Green);
Print ("Error = " , GetLastError() );


And the result :

2013.01.02 00:08:45    EURUSD EURUSD,M1: Error = 130
2013.01.02 00:08:45    EURUSD EURUSD,M1: Ask=1.3265   -   Bid=1.3263   - SL=1.326   - Bid-sl=0.0003   - StopLevel=0


If i follow the Book, for a BUY order the Sl should be : Bid - SL >= Stop Level


Here the stopLevel is 0 and my SL is 0.0003 which is more than 0.


Any idea ?

Thanks

Nicolas

 
Could be ECN broker. Try sending order without SL and TP. Then OrderModify(). Example Here.
 
Thanks, i'll try that tomorrow !
 

It's working

thanks 

Reason: