A very big problem I encountered when trading strategy in tradingview that I could not combine the two strategies. For example, I need a variable to be true whenever the price goes up in the Bollinger Band so that I can use it in the future. If anyone knows the solution to this problem, I will be happy to use his experiences.
if crossover(x > y)
test = true
if test
strategy.entry("Short", strategy.short, oca_type=strategy.oca.cancel, comment="Short")
You have to create a mutable variable and initialize it in the global scope first: Note that
crossover
function accept arguments separated with comma.or