stock-desk
文件大小: unknow
源码售价: 5 个金币 积分规则     积分充值
资源说明:Small Ruby based stock trading DSL - It's a work in progress
Portfolio is a stock management and analysis system written in Ruby.

It aims to offer a clean and extensible DSL for the creation of a stock portfolio, allowing you to run it on a daily basis to analyse a large number of stock symbols(available through finance.yahoo.com).

A simple example is as follows:

Portfolio.chart :gld do
  study :simple_moving_average, 15, 28
end

This will download the gold(GLD) chart and add two SMA's to it at lengths of 15 & 28. They can then be accessed through

Portfolio[:gld] =>  45.5 Or whatever the SMA at a length of 15 is
# TODO: Add a better way to get to ticks then through standard array syntax

# ISSUES
  If you come across any issues/errors with any of the code especially the algorithms, or if you find a faster(I only care if it's faster or incorrect) way to do an algorithm, please send a patch

# TODO
1. Add analysis DSL to run analysis over your portfolio
2. Add a messaging layer for communicating with owner
3. Add a persistence layer to know what you're portfolio state is(i.e. bought, sold, or just watching)
4. Add more algorithms
5. Optimise existing algorithms for speed
6. Add database support for caching charts in the db(not that important IMO)



# EVENTUALLY

You be able to use a DSL file, something like. 

long_trade.tdp

Portfolio(:long) do
  study :simple_moving_average, 15, 28
  
  action :email, "cameron@snepo.com" do
    when sma_15, :crosses, sma_28
  end
end

Portfolio(:long).add :charts => [:spy, :gld, :aapl, :msft]

本源码包内暂不包含可直接显示的源代码文件,请下载源码包。