Did you know that you can navigate the posts by swiping left and right?

Analyzing stock market in Haskell

27 Mar 2015 . category: . Comments

Haskell currently has two packages related to the stock market which are called “Finance-Quote-Yahoo” and “yahoo-finance-conduit”. Both hackages only extract raw data from the Yahoo Finance. This project pretends to be tool for developers who creates stock trading advice software.

The information this module will give would be according historical prices. It is important to highlight that the stock market is unpredictable. Nobody, even Warren Buffet, knows what will happen the next month, the next 3 or 25 years.

Firstly, I will re-write the both hackages mentioned above in order to remove the Yahoo Finance dependency. Yahoo Finance will be optional. Secondly I will write utilities (functions) to get useful trading information. Some of these functions will be:

*Functions related to highest and lowest prices*

- Get the highest stock price given a range of dates.

- Get the lowest stock price given a range of dates.

- Get the lowest stock price close given a range of dates.

- Get the highest stock price close given a range of dates.

… and more similar functions indicating the highest or lower average price of the day, the open price…

*Find supports and resistances

- List the possible supports of the stock prices given a range of dates

- List the possible resistances of the stock prices given a range of dates

*Functions related to get information according the day of the week (Monday, Thursday…Friday)*

- Know the average of the stock given a day of the week (Monday, Thursday…Friday)

- Know the day of the week (Monday, Thursday…Friday) in which the average of the price of the stocks of certain company was the highest.

- Given a tendency (Bearish, Neutral or Bullish), know the best day of the month ot buy a stock. The results of this functions could be, of course, wrong. (This is stock market) But I will follow the Ichimoku Clouds study.

… and much more functions which can be kind of redundant but useful and could come to my mind on the way…

Finally, this library will plot charts

*Allow to plot using GNU Plot (hackage)
- Linear chart
- Candlestick chart (dayly, weekly…)
- Draw the moving average
- Ichimoku Clouds study


  • Create the data types to storage data about prices independent if it is Google Finance or Yahoo Finance. Get data from Yahoo Finance API. Parser for CV files from Yahoo Finance and Google Finance. Create simple functions. (3 weeks) 
  • Make Ichimoku clouds and moving average studies (5 weeks)
  • Get to plot the chart of the prices of the stock market (4 weeks)

    If time remains I will write more useful functions to extract important information from the historical prices or I will add more graphical studies.

About me:
My name is Fabián Orccón. I am student at PUCP university. The first time I saw Haskell was when I met a friend in my first cycles of university who was doing a thesis in Haskell. However, I really got more into Haskell when I had a course where we have Haskell as part of the course. 

I am a humble investor in the stock and foreign exchange market. Because I am fascinated about computer programming, In my free times, I was writing (on my free times) a tool (in Haskell) to extract information from the historical prices. This Google Summer Of Code is an opportunity to go further and to get this tool more powerful.





Fabián Orccón is an awesome person. He lives in Perú, the land of the Incas.