Back to Community
Implementing Frog in the Pan algorithm from Alpha Architects

In the algorithm below I attempted to integrate the Frog In the Pan metric discussed in this post on the Alpha Architect blog. With their Robust Asset Allocation framework. The system first selects the top 100 (top 20% of 500 stocks in universe) performers based on 12-month lookback then sorts on the FIP ID metric discussed in the post and invests in the top 20 stocks (top 20% from 100 winners). At first glance the algorithm seems to add value, it outperforms a simple 12 month look back algorithm significantly. However if you simply adjust the 12-month lookback algorithm to select the top 20 stocks instead of the top 100 the simple 12-month lookback algorithm achieves the same performance as double sorting with FIP ID. I’ve tested the algorithm with various values and number of stocks to select and the relationship seems to hold. So as far as I can tell integrating the Frog in the Pan ID metric into the Robust Asset allocation strategy doesn’t add much value. At least over the period I tested 2006-2015.

Note, both algorithms apply the RAA framework for risk management.

Clone Algorithm
254
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 568e8ab422d8fe1180543dae
There was a runtime error.
14 responses

This is the results of a simple 12-month lookback algorithm that selects the top 100 winners. At first glance the FIP algorithm seems to add value.

Clone Algorithm
382
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 568e9e28e9f91d119d16283a
There was a runtime error.

However running the same 12-month lookback algo but only selecting the top 20 winners, produces similar results to the FIP algorithm above.

Clone Algorithm
382
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 568e9cdae9f91d119d162833
There was a runtime error.

PvR 146%

As per Wes Gray's recommendation I reran the Frog algo and allowed it to choose the top 50 stocks.

Clone Algorithm
254
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 568fc20c60dedc116f7dd98e
There was a runtime error.

Here are the results of the simple 12-month lookback with the cutoff set to 50 stocks. Again, the FIP algo, doesn't seem to add a lot of value.

Clone Algorithm
382
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 568fc4c7107699117a3cc217
There was a runtime error.

Very interesting share. Attached is the tear-sheet for the first version.

Loading notebook preview...
Notebook previews are currently unavailable.
Disclaimer

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.

The one referred to in the tearsheet with ending chart value of ~277% started with $1M and transacted $2M so ending returns per dollar activated (PvR) are half of what is shown in that original chart.

Mark, I like the class layout of this algorithm....The ability to have multiple strategies running in the same algorithm.

However, this one does not run with minute. I found the issue and had it develope candidates regardless of being a buy day or not, but then it runs out of memory.

Any tips on using this layout to run algorithms with minute data?

Hi John,

If you replace any references to mavg with numpy.mean you should be able to get it to run in minute mode, thought there may be other discrepancies in the algorithm. Have a look at this thread.

Why does the algorithm not run from Feb08-May09, there is no performance data? Thanks.

Its part of the Robust Asset Allocation model. It stopped running because it saw momentum and excess returns drop off. Look for an Article about RAA on Alpha Architect. I think the link is in the comments of the source code

I update the framework here, to work in minute mode.

Regards,
Mark

Is it possible to modify the value strategy to filter for intrinsic value?

A great example is the Chepakovich Valuation Model found here: http://x-fin.com/valuation/chepakovich-valuation-model/

I get an error below when i clone and build this strategy - how do i fix it?

There was a runtime error.
AttributeError: 'Mom_Strat' object has no attribute 'candidates'
... USER ALGORITHM:153, in get_winners
h = history( self.lookback,'1d','price')[self.candidates]