Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
RSI AND OPEN Algo[250% Return in one year]

I am new to Quantopian, this is my first published backtest, any type of criticism is welcome.

3 responses

Be cautious of your leverage (ie your borrowing). I typically always record the leverage and make sure (at least in initial testing) that it never goes above one. You should always be able to adjust it later for higher returns if desired. Add a line like this in a scheduled function

   record(leverage=context.account.leverage)

Attached is your algo with this added. Note your leverage varies from 1.6 to over 7. Not really viable in live trading. The Q contest requires a max leverage of 3.

Thank you so much I was havong trouble with that.

Margin is illusory profit. Apportion the ordering, this keeps maximum intraday (all time) leverage just below 1.

            order_target_percent(stock, 1.0 / len(context.stocks))