You can add a search for the highest bars to determine the closed order points.
You can add a filter by the value of the (you can customized it separately for buying and selling).
Alerts for buying and selling are set.
It can be used to work with bots, for example 3COMMAS DCA bot.
Signal Condition Settings:
(Buy) Lowest Bar
The closing of the current bar is lower than the closing of the bars back in this range
(Buy) value <
The index is below this value
(Sell) Highest Bar
The closing of the current bar is higher than the closing of bars in this range
(Sell) value >
The index is higher than this value
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.