Hey men,

So I've been playing around and I understand things can attain my email and provide me an alert however I need it to take action in the right time which I'm having difficulties with.
I need it to test for the conditions following a candle close and if the conditions are met it sends an email.

This is what I came up with but it's not working at this time so if somebody could tell me what is wrong I would appreciate it.

Here is the code:
https://pastebin.com/1BcDX5Ys


Thanks!