I would like to test performance of the strategy if leverage is allowed. Is it possible to do that?
Also it would be nice to have possibility to see performance of the strategy if short-selling is allowed. The same question: is it possible?
I would like to test performance of the strategy if leverage is allowed. Is it possible to do that?
Also it would be nice to have possibility to see performance of the strategy if short-selling is allowed. The same question: is it possible?
Yes both of these are possible, there are no inherent limits on leverage in the code. You will have to track your own leverage but could make it 1000x leveraged if you so desired.
Its not that hard to do yourself. The harder part is just coming up with a margin rate that is realistic. That data is hard to come by IMHO.
I have related question, in my algo I always have in my order_target_percent 1 or less but still the context.account.leverage shows leverage between 1 and 4 depened on the trading days, how can it be ?
1. how can I detect where is the issue ?
2. How can I tell quantopain to disallow any kind of leverage