December 2013
Beginner to intermediate
286 pages
5h 46m
English
The market data will be pulled from Yahoo! Finance on a daily basis; we'll use closing prices and from them calculate the data needed. The data will be downloaded once the Download data button in the GUI is clicked on. The following is the code to illustrate how downloading can be handled by a background thread:
let fetchOne(url:string) =
let uri = new System.Uri(url)
let client = new WebClient()
let html = client.DownloadString(uri)
html
let downloadNewData(url1:string, url2:string) =
let worker = new BackgroundWorker()
worker.DoWork.Add(fun args ->
printfn("starting background thread")
let data = fetchOne(url)
printfn "%A" data)
worker.RunWorkerAsync()The trading system will follow these steps from the ...
Read now
Unlock full access