Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Personal Trader Toolbox
Haskell
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
data
doc
examples
src/PTrader
.gitignore
LICENSE
README.org
Setup.hs
ptrader.cabal

README.org

Introduction

PTrader provides a Stock Trader framework. It allows to get real time stock info from finances.yahoo.com and pretty-print the results on a terminal.

Install

Requirements: curl dev library must be installed to install curl package.

(On ubuntu: apt-get install libcurl4-gnutls-dev.)

With the usual commands to install as a user library, from the source folder:

cabal install --user

In Ubuntu, sometime the libraries fail to install as user. You can try to install the depends in global and then the ptrader as user:

sudo cabal install split==0.1.* curl==1.3.* ansi-terminal==0.5.* --global
cabal install --user

Running the example:

ghci examples/example01.hs
*Main> main

Test on:

  • Ubuntu, ghc-7.0.3, Haskell Platform 2011.4.0.0

Cookbook

Get current stocks

import PTrader.Portfolio
runPortfolio ownedStocks "../portfolio.db"

Add profit

import PTrader.Portfolio
import Data.Time.Calendar
runPortfolio (insertProfit (fromGregorian 2012 5 24) "FER.MC" Dividend 11.85 ) "../portfolio.db"
Something went wrong with that request. Please try again.