While backtesting a pine strategy on tradingview I noticed that the docs allow to and use couple of options to set a leverage (just like you have on exchanges while trading futures/contracts).
Hence, as per the docs recommendations, I added the following parameters in the first line of the script (a.k.a strategy declaration) in order to use *2 leverage (200%):
strategy("Strategy",
overlay = true,
calc_on_every_tick=true,
max_bars_back = 1000,
max_lines_count = 400,
max_labels_count = 400,
process_orders_on_close=true,
default_qty_value=200,
default_qty_type=strategy.percent_of_equity,
initial_capital=2000,
precision=8
)
Nevertheless, when i look into performance summary and list of trades, I have the exact same results I had without leverage. For the record, if I open the strategy input panel manually, i see that everything seems to be correctly set up (% of equity, 200% of capital..)
Is it anything else I need in order to take leverage into account while backtesting?
Any input appreciated