Are you checking the error code and the trade result code?
They will tell you the reason for the failure. "Print" them out. It will be reported in the Journal log as well.
Show us the log output if you are not able to resolve it
I checked the journal and I think I found out what is the problem. There were two kinds of warnings:
1) "failed exchange sell 1 BTC.jt at 18080.67 [Only long positions are allowed]"
I think that means the broker only allows long positions. So, I used a different broker and a different market.
2) "failed instant sell 0.01 EURUSD at 1.09113 sl: 1.08914 tp: 1.09214 [Invalid stops]"
I think the stop loss (sl) and take profit (tp) values I used were calculated wrongly. I changed them and the warning was resolved.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I have used this line of code to open a long positions, and it works well:
However, when I try the same thing with the short positions, no sell position is opened:
What's the problem?