The script you have provided submits the stop orders at an invalid price.
A sell stop order must be submitted with the stop price below the current bid price. You are placing these at the Close plus 15 ticks which is most likely far above the current bid and is an invalid price for a sell stop order.
Below is a link to a video of testing the script.
Comment