Using leverage in backtests

Posted By: coinpump

Using leverage in backtests - 01/05/22 03:07

Hi again, new zorro s user here.

How can I use leverage in my tests? I changed the "market" column in the assets but I don't think I'm doing it correctly. Is there a way to do it programmatically in the script?

Thank you! Great software by the way.
Posted By: Petra

Re: Using leverage in backtests - 01/05/22 11:32

Set MarginCost to the current price divided by leverage.
Posted By: coinpump

Re: Using leverage in backtests - 01/05/22 15:22

Can you give me an example doing this inside a script? Is it as simple as this?

MarginCost = price(0) / 3;

I have tried changing the MarginCost in the assets file, but the test results are the same. Can you give me an example of changing the leverage with both the assets file and inside a script?
© 2024 lite-C Forums