Recording Oanda's Streaming Prices

As a quick update following on from my previous post about Market Profile, with a bit of help I have written the following command line code to capture streaming prices to file

stdbuf -oL -eL curl -s -H "Content-Type: application/json" -H "Authorization: Bearer XXX..." "https://stream-fxtrade.oanda.com/v3/accounts/XXX-XXX-XXXXXX-XXX/pricing/stream?instruments=EUR_USD" | jq --raw-output --unbuffered '[.time, .bids[0].price, .asks[0].price] | @csv' | sed -u 's/["Z]//g' | sed -u 's/[-T:]/,/g' >> ~/path/to/append/to/output

In my previous post I mentioned that capturing streaming tick data would be a whole new infrastructure project, however it seems that the above one line of code in the command line would suffice. I still do not intend to routinely capture such streaming tick data for a host of reasons, but I am going to capture some data in order to calibrate the approach used in my previous post.

More in due course. 

Leave a Reply

Your email address will not be published. Required fields are marked *