Skip to content

Instantly share code, notes, and snippets.

View datiti's full-sized avatar

Cyrille Mescam datiti

View GitHub Profile
@datiti
datiti / A_README
Created November 3, 2017 00:38 — forked from AndyFaibishenko/A_README
Example FIX to JSON mapper
This Gist contains an example of how to write a a FIX protocol parser using QuickFIX/J.
It also includes the XML data dictionary and a sample FIX message file with one OrderList message.
If you want to build/run this, you will need to link with QuickFIX/J and Jackson jars:
quickfixj-all-1.5.3.jar
mina-core-1.1.7.jar
slf4j-api-1.6.3.jar
log4j-1.2.15.jar
jackson-core-2.5.1.jar
jackson-databind-2.5.1.jar
jackson-annotations-2.5.1.jar
@datiti
datiti / morningstar.R
Created December 13, 2017 16:58 — forked from anonymous/morningstar.R
How to retrieve data from Morningstar
require(RCurl)
require(jsonlite)
myticker<-"FB"
url.histprice<-function(x){ return(paste0("http://globalquote.morningstar.com/globalcomponent/RealtimeHistoricalStockData.ashx?ticker=",x,"&showVol=true&dtype=his&f=d&curry=USD&range=1900-1-1|2014-10-10&isD=true&isS=true&hasF=true&ProdCode=DIRECT"))}
url.keyratios<-function(x){return(paste0("http://financials.morningstar.com/ajax/exportKR2CSV.html?t=",x))}
#Retrieve historical prices
json.histprice<-getURL(url.histprice(myticker))
json.histprice<-sub("NaN","\"NA\"",json.histprice)