stoploss error

 

hello,

am sending an order using this statement

TicketOrderBuy=OrderSend(Symbol(), OP_BUY, OrderQuantity, Ask, Slippage, Ask-StopLossPips*Point*PointFactor,
                     Ask+TakeProfitPips*Point*PointFactor,"", 1, 0, Green);
      

where in this case PointFactor =1 , stoplevel =0 , StopLossPips and TakeProfitPips are 10

at stoploss argument i am having a differnce of 10 pips from Ask but still am receiving an error of invalid stops . i would be grateful if any will help me getting rid of this error 

thanks

 
tazz90:

hello,

am sending an order using this statement

where in this case PointFactor =1 , stoplevel =0 , StopLossPips and TakeProfitPips are 0

at stoploss argument i am having a differnce of 10 pips from Ask but still am receiving an error of invalid stops . i would be grateful if any will help me getting rid of this error 

thanks





tazz90:


I had a similar problem a couple of days ago and was showed how to fix.


Run this test:

  https://www.mql5.com/en/forum/143043/page2#746319


Tell me what the result was, if grey or not.

 
tazz90:

hello,

am sending an order using this statement

where in this case PointFactor =1 , stoplevel =0 , StopLossPips and TakeProfitPips are 0

at stoploss argument i am having a differnce of 10 pips from Ask but still am receiving an error of invalid stops . i would be grateful if any will help me getting rid of this error 

So this means you are trying to set the SL and TP at Ask . . .  that isn't going to work,  why do you think it would ?
 
RaptorUK:
So this means you are trying to set the SL and TP at Ask . . .  that isn't going to work,  why do you think it would ?

while placing a buy order should i not be using ask as current price for stop loss or take profit ???
 
tazz90:
while placing a buy order should i not be using ask as current price for stop loss or take profit ???
That's up to you and your strategy,  you said  "StopLossPips and TakeProfitPips are 0"  Ask-StopLossPips*Point*PointFactor  would then equal Ask - 0.0 which is Ask
 
RaptorUK:
That's up to you and your strategy,  you said  "StopLossPips and TakeProfitPips are 0"  Ask-StopLossPips*Point*PointFactor  would then equal Ask - 0.0 which is Ask


oh GOD ... typing mistake am sorry its actually 10
 
tazz90:

oh GOD ... typing mistake am sorry its actually 10
Ah,  OK.  What is your Stoplevel and Freezelevel ?  and have you checked if your Broker is an ECN type ?  See link posted by ZacharyRC