Invalid stops

 

Hi, Im getting error 130 for a pending order. All the numbers seem correct, I don't understand why Im getting the error.

See attachment

Red upward arrow indicates the candle whose open is the time when Im trying to place BuyStop order. Lower line is the stoploss, upper one is the take profit and the middle one is the pending price.

The numbers on the upper left corner of the screen are: Price, SL, TP, Lots

Can anyone help?

Thanks

 
Check the type of pending order you are use (stop vs limit) and make sure your TP and SL are on the correct sides of the pending price, for that order
 
Thanks for quick reply. Ive checked them already, its correct, both are on the correct sides. In the indicated example the OrderType() is 4 = BuyStop.
 
mkheidzedavid:
Thanks for quick reply. Ive checked them already, its correct, both are on the correct sides. In the indicated example the OrderType() is 4 = BuyStop.

Could it be that accidental the new EntryPrice == OrderOpenPrice() of the PendingOrder and therefore StopLoss and ProfitTarget wouldn't change?

gooly

 
gooly:

Could it be that accidental the new EntryPrice == OrderOpenPrice() of the PendingOrder and therefore StopLoss and ProfitTarget wouldn't change?

gooly



In the code I have that comparison, so that case is excluded. Weird...
 
Is the broker ECN? If not, did you check the stoplevel?
 
Russian broker - InstaForex. StopLevel is written on the screen: the second number - 1.3241
 
mkheidzedavid:
Russian broker - InstaForex. StopLevel is written on the screen: the second number - 1.3241


that is not Stoplevel that is your StopLoss setting

looks like you try to open a pendingtrade to tight at level Bid or Ask

check the distance between orderopenprice with bid or ask also

 
deVries:


that is not Stoplevel that is your StopLoss setting

looks like you try to open a pendingtrade to tight at level Bid or Ask

check the distance between orderopenprice with bid or ask also



And what should be the distance with the current bid/ask and the pending price? Spread?
 
mkheidzedavid:


And what should be the distance with the current bid/ask and the pending price? Spread?

(see Requirements and Limitations in Making Trades).
 

Also you can't discuss brokers on this forum.. but after you mention that name, I'd say check ForexPeaceArmy before you open a live account :|

In fact, just don't open a live account.

Reason: