Do you know if the problem would be with my script or the setting on wundertrading
also noticed it closed a losing trade at the safety stop loss of 3% I put in wundertrading not at 2% which I have coded in the script.
if X>=1 then do some code
and
if X<=1 then do some other code
Then both of those instructions will be executed when X had a value of 1, which could explain why your bot opened two trades at the same time on the opposite direction, anyway I will recommend that you use your bot in a demo account if you can and only once you have debugged all the possible issues you try to use it with real money on the line.