I managed to finish the code up to this point, but for some reason it doesn't work. Can you help me?
Please don't just say " it doesn't work". That can mean almost anything.
Explain what the problem is.
Your code appears to be set up so that it closes a trade anytime (after 10 seconds) that the trade is in loss.
Please don't just say " it doesn't work". That can mean almost anything.
Explain what the problem is.
Your code appears to be set up so that it closes a trade anytime (after 10 seconds) that the trade is in loss.
You're right, I'm sorry.
What happens is that the position is not being closed.
But this has been a surprise for me because I validated each step of the code and everything seems to be ok. So it must be something very simple that I'm forgetting.
When you are faced with such scenarios, it is very easy to debug by verbosing your code. That is, put a Print() statement inside your main blocks of logic (IF statements, loops, etc) to see what is going on, and if these blocks are being called and what the main variables store.
You will be surprised how quickly this can resolve such bugs for you. My 2 cents.

- 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 managed to finish the code up to this point, but for some reason it doesn't work. Can you help me?