As far as I see, your script matches your description with following exceptions -

- TP is missing and the description says nothing about a limitation to only one open position.

- Stop is set after the trade was already entered - must be set before.

- the hour calculation looks wrong. Correct: if(lhour(UTC) >= 7 and lhour(UTC) <= 21) { ... put the rest here ... }