OP_BUYSTOP/OP_SELLSTOP OrderSend with SL=0 and TP=0 return me error 130 (invalid stops!) - page 2

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
@Irwan: The threadstarter wrote: "with SL=0 and TP = 0" ;-)
Here my test code: (Snippet) where an Order is set without SL and TP and after successful creation, I add SL and TP. (Only in this case. Not always... ;-) )
Here are the results of the code and the results of manual trading: (From bottom to top)
1. I first tried to open an order by code, without SL and TP as a sell stop order.
-> I got the error message Invalid SL or TP.
2. I opened a market order by code
-> Success, but modification of SL and TP after the order was placed failed. (For the moment not so important, because I did not check the min values for SL and TP)
3. I've tested, if the sell stop is the problem and opened a sell stop without TP and SL by hand.
-> Success.
I've tried sell stop orders by code with slippage-values from 0 to 100. All failed.
I must say, that I have never traded futures and maybe there are some things I do not know...
My code works fine for all other instrument types (forex, indices, cfd), but in this special case
I have a problem...
@Irwan: The threadstarter wrote: "with SL=0 and TP = 0" ;-)
Here my test code: (Snippet) where an Order is set without SL and TP and after successful creation, I add SL and TP. (Only in this case. Not always... ;-) )
Here are the results of the code and the results of manual trading: (From bottom to top)
1. I first tried to open an order by code, without SL and TP as a sell stop order.
-> I got the error message Invalid SL or TP.
2. I opened a market order by code
-> Success, but modification of SL and TP after the order was placed failed. (For the moment not so important, because I did not check the min values for SL and TP)
3. I've tested, if the sell stop is the problem and opened a sell stop without TP and SL by hand.
-> Success.
I've tried sell stop orders by code with slippage-values from 0 to 100. All failed.
I must say, that I have never traded futures and maybe there are some things I do not know...
My code works fine for all other instrument types (forex, indices, cfd), but in this special case
I have a problem...
The ticksize for this symbol is 1.00, you can use price 1057.61 or 1116.88
Forum on trading, automated trading systems and testing trading strategies
OP_BUYSTOP/OP_SELLSTOP OrderSend with SL=0 and TP=0 return me error 130 (invalid stops!)
Alain Verleyen, 2015.01.08 16:30
A BUY_STOP needs to be place at a higher price than market price, not lower.
Is your price calculated ? You have to normalize your price in this case.
Normalized OrderInPrice? Or normalized OrderTakeProfit and/or OrderStopLoss? Or both?
If it's necessary for SL and TP than SL = 0 and/or TP = 0 is not allowed?
Thank you!