This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ############################################################ | |
| ## Content of the Traders in Financial Futures (TFF) Report | |
| ## http://www.cftc.gov/ucm/groups/public/@commitmentsoftraders/documents/file/tfmexplanatorynotes.pdf | |
| ############################################################ | |
| # Dealer/Intermediary | |
| # These participants are what are typically described as the "sell side” of the market. Though they | |
| # may not predominately sell futures, they do design and sell various financial assets to clients. | |
| # They tend to have matched books or offset their risk across markets and clients. Futures | |
| # contracts are part of the pricing and balancing of risk associated with the products they sell and | |
| # their activities. These include large banks (U.S. and non-U.S.) and dealers in securities, swaps |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #sources | |
| #https://www.quandl.com/CURRFX/USDCAD-Currency-Exchange-Rates-USD-vs-CAD | |
| #curl https://www.quandl.com/api/v1/datasets/CURRFX/USDCAD.csv -o /tmp/USDCAD.csv | |
| #https://www.quandl.com/DOE/RWTC-WTI-Crude-Oil-Spot-Price-Cushing-OK-FOB | |
| #curl https://www.quandl.com/api/v1/datasets/DOE/RWTC.csv -o /tmp/RWTC.csv | |
| library(xts) | |
| library(ggplot2) | |
| usd.cad <- read.csv("/tmp/USDCAD.csv") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(IBrokers) | |
| library(twsInstrument) | |
| tws <- twsConnect(host='127.0.0.1', port=4001) | |
| contract <- getContract("EUR.USD") | |
| reqHistoricalData( tws, contract, verbose=T, whatToShow="BID" ) | |
| reqHistoricalData( tws, contract, verbose=T, whatToShow="ASK" ) | |
| twsDisconnect(tws) |
NewerOlder