Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
How to control leverage

Hello,

I want to control leverage and limit it to never go above 1 while using order_value.

I know that most commonly this: context.target_pct_per_stock = 1.0 / len(context.stocks) is used when we have a list of stocks and are using order_target_percent but haven't found a way to limit leverage using order_value.

Apologies if this was a silly question.

1 response

you might be interested in this