I am writing a script in tradingview where i use moving average and rsi. I am a happy amateur on pine, but i have learnt some by studying the codes by the fantastic people who share both on tradingview and also, google sent me here to this site many times. I can not find an answer to this however.
In my strategy i would like to close 50% of my position when RSI crosses a value of 68 and then trail the rest of the position to MA20. I have been trying to use strategy.close, but i can not get it to work. It says i can not use boolean and need to use float.
So my question is, how do i define a RSI value crossover as a float for it to work? Or am i just completely lost in the bushes here?