0

I've written a trading indicator in Pine Script v5, to auto trade using bots. In manual back testing it performs very well but in real time, live trading, I get many "ghost" signals that trigger my bots on and no off signal, due to the characteristics of my script, I need to process data in real time, however, as it should, when a buy signal occurs, my bot signal triggers my bot into a deal, then, if the price recedes, the buy signal disappears and there is no notification to trigger my bot to close the deal that was started. Does anyone know how to write code so that when the buy signal disappears, I can send a close signal to my bot?

I've tried writing additional variables that would trigger on when long := false as well as adding that to my current script as an else or and else if statement... however, nothing triggers a signal that I can plot or alert on.

0 Answers0