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.
You may have the kernel of a viable strategy here, but your backtests aren't accurate because of the way Heikin Ashi candles are treated in Tradingview. They are synthetic candles and TV backtests will indicate trades based on the candles, not actual prices that you could have realized in live trading. An easy way to check for this is to check the trade history according to the backtest and then switch to normal candles and see the actual prices that were available at the time the trades were signaled.
This is not to say your work isn't valuable. Just be careful about treating the backtests as realistic historical performance. Hope this helps. Good luck!
Looks like a potentially profitable strategy. What time frame would you recommend?
I tried out the code on TSLA and ended up with a lot of green arrows, pic: https://gyazo.com/54315e75196d3714bc940490747df04c