FOREX Historical Carry Rates

Discussions about the testing and simulation of mechanical trading systems using historical data and other methods. Trading Blox Customers should post Trading Blox specific questions in the Customer Support forum.
Post Reply
mark kockerbeck
Contributor
Contributor
Posts: 3
Joined: Thu Feb 24, 2011 2:05 am

FOREX Historical Carry Rates

Post by mark kockerbeck » Tue Feb 16, 2016 8:23 pm

TradingBlox comes with sample FOREX pairs that include interest rates for various currencies (e.g. in Data\Forex\USD_Rates.txt).

Where do others get this historical information for pairs outside of the sample set? Places like HistData.com have esoteric pair *price* info but not the carry rates (which can have a big impact!).

Where do others get this data for their testing?

Tim Arnold
Site Admin
Site Admin
Posts: 8537
Joined: Tue Apr 06, 2004 1:41 pm
Location: Boston, MA
Contact:

Re: FOREX Historical Carry Rates

Post by Tim Arnold » Wed Feb 17, 2016 8:04 am

You can get the data from forex brokers like:
http://www.oanda.com/forex-trading/anal ... ical-rates

However each broker is likely different, so you should get the bid/ask and carry rates from the broker you are using.

Trading Blox has a real time direct and automated connection with FXCM and IB in beta now for Forex trading.

mark kockerbeck
Contributor
Contributor
Posts: 3
Joined: Thu Feb 24, 2011 2:05 am

Re: FOREX Historical Carry Rates

Post by mark kockerbeck » Wed Feb 17, 2016 2:14 pm

Thanks! That Oanda page seems broken. The submit input tag is not within the form element & thus won't actually submit... but with a little inline editing, I got the result needed.

The cURL command for anyone looking to automatically parse all currency rates for the max date range is below too (in case it's useful). A few things to note:
* Date range is the first part of the value block (URL encoded)
* Sed pipelines are also below to strip out the HTML (much better ways to do this)
* A little date parsing & it's close to looking like the *_Rates.txt files

Code: Select all

curl 'https://fx1.oanda.com/mod_perl/user/interestrates.pl' \
  -H 'Origin: http://www.oanda.com' \
  -H 'Accept-Encoding: gzip, deflate' \
  -H 'Accept-Language: en-US,en;q=0.8,mt;q=0.6' \
  -H 'Upgrade-Insecure-Requests: 1' -H 'User-Agent: Script' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' \
  -H 'Cache-Control: max-age=0' \
  -H 'Referer: http://www.oanda.com/forex-trading/analysis/historical-rates' \
  -H 'Connection: keep-alive' -H 'DNT: 1' \
  --data 'startdate=01%2F01%2F2000&enddate=01%2F01%2F2018&currency=AUD&currency=GBP&currency=CAD&currency=CNY&currency=CZK&currency=DKK&currency=EUR&currency=HUF&currency=HKD&currency=INR&currency=JPY&currency=MXN&currency=TWD&currency=NZD&currency=NOK&currency=PLN&currency=SAR&currency=SGD&currency=ZAR&currency=SEK&currency=CHF&currency=THB&currency=TRY&currency=USD&currency=XAU&currency=XAG&currency=US30&currency=NAS100&currency=SPX500&currency=UK100&currency=DE30&currency=HK33&currency=JP225&currency=BCO&currency=CORN&currency=WHEAT&currency=NL25&currency=FR40&currency=EU50&currency=SUGAR&currency=SOYBN&currency=NATGAS&currency=WTICO&currency=XCU&currency=USB02Y&currency=USB05Y&currency=USB10Y&currency=USB30Y&currency=CH20&currency=DE10YB&currency=US2000&currency=UK10YB' \
  --compressed \
| sed 's/<[^>]*>/,/g' | sed 's/,,/,/g'| sed 's/,,/,/g' | sed 's/^..//' | sed 's/.$//g'

Tim Arnold
Site Admin
Site Admin
Posts: 8537
Joined: Tue Apr 06, 2004 1:41 pm
Location: Boston, MA
Contact:

Re: FOREX Historical Carry Rates

Post by Tim Arnold » Wed Feb 17, 2016 5:01 pm

Thanks, that's great.

Post Reply