you are all nothing to me
you are all nothing to me
The leverage in this algo starts out over 800 and then remains over 20 for the better part of the backtest. Not even Warren Buffet could get a broker to extend them that type of margin. Retail investors are generally limited to a leverage of 2x.
The algo doesn't buy and hold an equally weighted portfolio as intended. The weight shouldn't be specified as 50 but rather something like this
# buy them all on the first day, then stop
# equally weight each stock
weight = 1 / len(context.stocks)
if not context.bought:
for stock in context.stocks:
order_target_percent(stock, weight)
context.bought = True
Attached is an algo which is more representative of a 'buy and hold' strategy on some hand picked stocks (once we knew they were going to be great) .
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.
Uhhh your algorithm gets a net return of 27%, mine has over 600000%, I didn't have to think I'd have to explain the difference to someone with an interest in quantitative trading...
@Thomas,
The Quantopian software is a simulator, which if fed unrealistic parameters will produce unrealistic results that won't verify with real life.
Even if fed "realistic" parameters, it's(the simulator's) out-of-sample(forward-in-time) performance might not match what happens in real-time live-trading(real-life).
In the case of your original algorithm, you'd have to put in your $1k, and get someone to loan you $80k(if as Dan says, it starts out with leverage of 80x) to start off your live trading. If you lose enough so that your large-leverage loan is called...say at -$40k..., you'd face the leveraged version of "gambler's ruin", and owe someone $40k...perhaps in the first day of live trading! Unfortunately, in real life, one of the unintended consequences of risk can be:
On the other hand, the "order_target_percentage()" command and documentation is always tricky, and I've been fooled by it more than once, even when trying to use it in live-trading. I just don't use it anymore except when doing paper-trading research.
alan