Your broker does not allow sending Stop-loss/Take-profit along with order. You'll have to modify the order with sl and tp after its successful.
What error do you get ? You probably have an ECN Broker and need to place the order with TP & SL set to 0 then do an OrderModify to set the TP & SL . . . plenty of stuff here: http://crum.be/ecn

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
Dear Coders,
I tried to write a simple code but it doesn't place any order if I set stop/target level on it. The code is below: