GithubHelp home page GithubHelp logo

fudong1127 / quant Goto Github PK

View Code? Open in Web Editor NEW

This project forked from maihde/quant

0.0 1.0 0.0 138 KB

Quant is a python-based system for stock trading strategy backtesting

License: GNU General Public License v2.0

quant's Introduction

Quant

License

Copyright (C) 2011 Michael Ihde

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.

Intro

Quant is a python-based, technical analysis tool for trading strategies. It takes a particularily simplistic view of the market and only allows trading decisions to be made after the market has closed.

The goal of Quant is to provide a useful experimentation framework to explore trading strategies that are applicable to the casual investor who is managing a 401k, IRA, or other long-term investment.

Quant can be used without any programming knowledge, but a decent grasp of Python will be required to create customized strategies.

Install

Quant runs directly from it's own directory, as such Quant is not 'installed' in the usual sense. Quant does require a few libraries to be available

On Ubuntu Linux::
sudo apt-get install python-tables python-sqlite python-matplotlib python-yaml

Getting Started

Quant stores it's configuration and all data in ~/.quant.

All Quant portfolios are stored in ~/.quant/quant.cfg as a YAML entry. Entires in a portfolio can either be listed as absolute quantities or as cash values. The former is useful is you are using Quant to analyze a real portfolio that you currently own. The latter is useful for backtesting strategies as it ensures that your portfolio assets have proper ratios regardless of the assets price at the start of the simulation.

Here is an example quant.cfg, the first portfolio uses cash values while the second portfolio uses absolute quantities:

portfolios:
    example_one: {$: 0, IWM: $30000, SPY: $45000, VWO: $25000}
    example_two: {$: 0, IWM: 30, SPY: 100, VWO: 50}

Quant can be run in three modes:

  1. Interactive
  2. One-shot
  3. Scripted
To run in interactive mode, simply execute quant::
$ ./quant
To run in one-shot mode::
$ ./quant <command> <argments>
Finally, to run a script of commands::
$ ./quant < commands.txt

An example script is provided in scripts/example.txt. It is suggested that you read it and then execute it:

$ ./quant < scripts/example.txt

Misc

If you are developing new strategies, you may want to install HDFView, as it will give you an easy way to explore the raw data in the output h5 files. HDFView can be downloaded from http://www.hdfgroup.org/hdf-java-html/hdfview/

You may also like to read these resources to learn more about Quantitive trading:

quant's People

Contributors

maihde 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.