Small Pinescript strategy based on ATR

Job ID: 36008687

Budget: $10 – $30 USD

i'm using ATR indicator to plot green dots above price and red dots below price.
Just need simple strategy to buy long if previous bar LOW is (Equal) OR (lower by maximum 1 tick) than the GREEN dots
or go short if previous bar HIGH is (Equal) OR (Higher by maximum 1 tick) than the RED dots.

i've attached the code im using for ATR. but it's basically just ATR period 10 and multiplier 3.01 to plot the dots.
you can also see here for what it looks like:
https://www.tradingview.com/chart/GGXfCaCe/
Related categories: Pine Script Trading