Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Forex Data

I am trying to import a small sample of forex data for running my strategy but the basic record function doesn't work. Data format pasted below.

symbol,ts,bid,ask,spot,runbet_spot
frxUSDJPY,2013-01-02 00:00:00,86.603,86.631,86.615,86.6151
frxUSDJPY,2013-01-02 00:00:01,86.611,86.621,86.615,86.615
frxUSDJPY,2013-01-02 00:00:02,86.608,86.626,86.616,86.6168

fetch_csv('https://dl.dropboxusercontent.com/s/8pabigfejb59wjv/feed.csv', date_column='ts',date_format='%Y/%m/%d %H:%M:%S')

record(Price=data[context.stock]['bid'])

It always complains of key error for 'bid'. I don't think "context.stock", makes sense.....but the backtester complains I need to set an SID. Am i missing something in the implementation?

9 responses

Hello,

You will need to specify a 'dummy' SID. This may help you a little but I've hardly used 'fetcher' myself.

P.

It works! Thanks a lot Peter

Actually there's a problem with SID(2). Coz it will always map to existing securities. "2" in this case maps to an existing stock. Can I create an underlying with a new sid? I couldn't find it in quantopian docs as it says that sid will always map to some existing security in the quantopian database.

When I use the order command in quantopian it places order based on the existing security and not the feed data I have provided!

Hello,

Quantopian only supports US securities at present. With your Forex data you would have to simulate your own orders, position values, remaining cash etc.

P.

are there any plans to support forex or futures data as well?

We're interested in supporting this later on, as well as adding additional data sources. However, at the present we're developing full functionality to support US securities. This is a commonly received request and we're listening!

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.

Forex, please! It`s essential!

Is there any other foreign exchange functionality options similar to quantopian?

It's not there yet!!