Back to Community
Macro Data

Hi,

I would need macro datas in my algos. Does anyone knows how to access PMIs, GDP, FX rates ?

Thanks

1 response

Hello Olivier,

Search here for algos that use 'fetch_csv' to import data, often from Quandl. The attached uses data from http://www.quandl.com/ISM/MAN_PMI-PMI

P.

Clone Algorithm
24
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
def initialize(context):
    context.dummySid = sid(2)
    fetch_csv("http://www.quandl.com/api/v1/datasets/ISM/MAN_PMI.csv?&trim_start=1948-01-01&trim_end=2013-12-13&sort_order=desc",
              symbol = "PMI",
              date_column = "Month",
              date_format = "%d/$m/%Y")

def handle_data(context, data):
    if "Index" in data["PMI"]:
        print data["PMI"]["Index"]
        record(PMI=data["PMI"]["Index"])
              
              
This backtest was created using an older version of the backtester. Please re-run this backtest to see results using the latest backtester. Learn more about the recent changes.
There was a runtime error.