Downloading stock prices in F# - Part VI - Code posted - Luca Bolognese

Downloading stock prices in F# - Part VI - Code posted

Luca -

☕ 1 min. read

Other parts:

An un­named friend told me that I should stop post­ing small snip­pets of code and in­stead post en­tire so­lu­tions on CodeGallery. I did it for this one and here is the link.

Here is what’s in the zip file:

  • BackTestF - main li­brary to down­load stock prices

  • Common.fs - com­mon things used in the rest of the pro­ject (i.e. data mod­el­ing and com­mon funcs)

  • html.fs - func­tions to scrap html ta­bles, rows and cells

  • loader.fs - this is where the main async down­load­ing al­go­rithms are im­ple­mented

  • per­sis­tence.fs - async sav­ing and load­ing of stock prices to files

  • al­go­rithms.fs - async cal­cu­la­tions of com­pound yearly re­turns given tick­ers and dates

  • dot­NetWrap­per.fs - gives a .NET friendly in­ter­face to the whole li­brary so that you can use it from C#/VB.NET

  • Tests - too few test­cases run­ning on xU­nit (you need to down­load xU­nit sep­a­rately to run them

  • ReturnCalculator - sim­ple con­sole ap­pli­ca­tion to show us­age of the li­brary

  • Bob - rough win­forms UI ap­pli­ca­tion that uses the li­brary. An un­named friend (Jonathan) promised me that he was go­ing to cre­ate a UI for my lit­tle li­brary. My re­quire­ments were very sim­ple: I want the best UI app of this cen­tury, one that fully takes ad­van­tage of the async na­ture of my code. Bob does­n’t fully sat­isfy my re­quire­ments yet 🙂

The code in per­sis­tence.fs, al­go­rithms.fs and es­pe­cially dot­netwrap­per.fs is pretty rough and un­in­ter­est­ing. This is why I don’t blog about it. I re­serve the right to do it if I get around to clean it up.

3 Comments

Comments

Could not locate the assembly "FSharp.PowerPack, Version=1.9.6.8, Culture=neutral, PublicKeyToken=a19089b1c74d0809". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

Just delete the reference to the assembly from the project and add it again.

0 Webmentions

These are webmentions via the IndieWeb and webmention.io.