Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Dynamic leverage based on a technical indicator

The idea is simple:
Use a technical indicator from the strategy results to define the leverage.

Example:
- Strategy: Buy SPY
- Use RSI 14 of the strategy returns and define a leverage inversed

Some cases:
- RSI 50: leverage = 1.0
- RSI 25: leverage = 2.0

Best,