Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Linking my external GARP strategy to Quantopian

I'm new to the platform was wondering if it could link to an external API to fetch data.

I have a really successful GARP strategy here https://investorsedge.net/Strategy/Definition/24459/23717 that I would like to explore setting up on the platform.

InvestorsEdge has an API/JSON which allows access to the ranking tables on a given day, so I'd like to be able to access the API, receive and parse the JSON ranking list and trade the top 10 stocks at the start of each month.

4 responses

Hi Liam,

The best way to do this is with our self-serve data api: https://www.quantopian.com/help#self_serve_data. Your full ranking can be imported as a factor in pipeline. From there you can analyze the factor in research, or use it in an algorithm.
You can use google sheets as glue to go from the InvestorsEdge JSON API to the csv format self-serve expects.

happy coding,
fawce

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.

Hi fawce,

Thanks for the info - I've had a quick read of the documents and I'm not sure if it will work (or more likely I've completely misunderstood how to use it...).
The data out of the ranking API looks like this:

{ date: '2018-07-12T00:00:00',
ranks: [
{
symbol: 'AAPL',
rank: 100.0
},
{
symbol: 'MSFT',
rank: 80.0
},
{
symbol: 'MU',
rank: 60.0
},
{
symbol: 'FB',
rank: 40.0
},
{
symbol: 'GOOG',
rank: 20.0
}
]
}

That can obviously translate to a simple csv file, but how do I use this structure within the trading logic of your platform? For instance, I may only want to consider trading stocks with a rank >= 80.

Thanks
Liam

Hi Liam,

If you can get your data into a .csv file and upload it to Quantopian using self-serve data, you can then use the Pipeline API to add that filtering logic to a research notebook or algorithm. Here's a template algorithm in which you could add your custom dataset. I added a couple of lines that would filter the universe of stocks using a rank field.

Note that the template won't do anything until you actually upload a dataset and update the algorithm code to add in your dataset.

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.

Hi Jamie,
That's great - thanks for that. I'll have a look in my copious amounts of spare time!
Liam