You've learned with the test script how to calculate the risk and print all parameters leading to it. Why don't you do this with your other script also? If you understood the formula in the test script, you just need to copy the print statement and apply exactly the same formula in your trading script.

Your own risk calculation was wrong, by factor 10 and more, because you were using a wrong formula and a wrong lot size - I told you that several times.