Coder Social home page Coder Social logo

carshalton's Introduction

Carshalton - A Trading Strategies test and simulator

Design

Modules

  • Tobor

    • get the price data via data vendors based on configuration
      • from live session (Google Finance)
      • from past data source (local mock data)
    • make calculations (e.g SMA, KDJ, MACD etc)
    • create feed and push down to the Oracle
  • Oracle

    • loads the strategies from the strategy base
    • give buy/sell advice based on position and other condition (watch list or holding list)
    • form an instruction and push down the Tobor
  • Hugo

    • listen to Oracle and ready to receive instruction
    • execute the instruction via portfolio object
  • Portfolio

    • holds the context of the program such as the watch list, investment size, etc
    • portfolio will be pass to other modules for reference
    • internally has a holding list (per stock) and transaction list (all the buy/sell transaction)
    • by the end of the day
      • calculate profit and loss based on the log transaction
      • write the transaction to a csv file
      • plot and save chart for each holding

Required libraries

  • pandas
  • matplotlib - charting
  • pydispatcher - message dispatch and subscribe
  • stockstats 0.2.0 - technical indicator calculation (SMA, KDJ etc)

How to run

  • make sure you have installed the above package
  • go to command line and type "py go.py"
  • results are located under result folder

Data Issue

Google Finance has data issue for price on the 20/11/2017

To do:

  • adding a logger

carshalton's People

Contributors

zpeng avatar

Watchers

 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.