Using several indicators will be better in carrying out analysis. And make sure you doing a backtest so you can find a higher probability from that indicator. You can use the history of the candle sticks in the market or Trading view.
About pinescript, does this mean you are testing a trading bot? If yes, sorry because I'm really ignorant about that. I heard sometimes Bots only work under certain conditions. For example, a bot for a bullish market, it will not work in a bearish or sideway market. Maybe you have to find a bot that suits market conditions.