I believe there are many friends who have been confused by the leverage problem of TradingView strategy, when backtesting, it is always unable to bring its own leverage, so it is impossible to do leverage sustained compounding, this key point, and many friends are looking forward to solve. In particular, the default_qty_value = 100, where 100 is the upper limit.
Here I have used the official RSI strategy for demonstration, using the qty to place orders. Through strategy.equity, leverage and close price, and rounding, directly calculate the specific number of contracts need to be opened.
I hope you can enjoy solving the leverage problem, and I look forward to your pointing out my problems and shortcomings to me. Thank you.