Coder Social home page Coder Social logo

stock-desk's Introduction

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] => <Portfolio::Chart ...

Portfolio[:gld].ticks[100].sma_15 => 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, "[email protected]" do
    when sma_15, :crosses, sma_28
  end
end

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

stock-desk's People

Stargazers

Erik Wrenholt avatar RS avatar Douglas Mendes avatar Cameron Barrie avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.