Giter Site home page Giter Site logo

vungods / double-top-and-bottom Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kelvonlys/double-top-and-bottom

0.0 0.0 0.0 152.27 MB

This project is to backtest the commonly used Double Top and Bottom chart pattern by using the Quandl API.

JavaScript 0.79% Python 71.10% HTML 4.70% Jupyter Notebook 23.42%

double-top-and-bottom's Introduction

Double-Top-and-Bottom

This project applies the commonly used double top and Bottom chart pattern to the HK equity market. A web interface is provided for user to search for particular stock and check whether a double top or double bottom has occurred.

Data Source

The data used in this project is provided by Qunadl. Quandl API is used to get the historical data of HK stocks in daily resolution.

Chart Pattern Detection

A double top or double bottom is detected when two consecutive peaks/bottoms of approximately the same price on a price-versus-time chart of a market. The first peak/bottom has to have higher volume than the second one as a way of confirmation. A chart pattern detection library is used in this project, developed by Marcos Duarte, https://github.com/demotu/BMC. The library returns an array of the crest and trough of a wave which in this case is the tops and bottoms of a stock's price.

Data Restructuring

Since the data retrieved from Quandl includes lots of extra data which does not fit into the chart detection library, the data has to go through a few steps of reconstruction by utilising the Pandas framework. The data is then packed into a numpy array for pattern detection.

Success Rate Calculation

Signal is generated when double top or bottom is formed with a confirmation of certain candlestick patterns. This strategy simulates a long or short position right after the signal is generated. Success rate is then calculated by checking if the price breaks the support level in a 5-days period.

Result and Visualization

Finally the result is plotted out by using Matplotlib and the success rate is displayed. The crosses are points where double tops and bottoms occur.

alt text

double-top-and-bottom's People

Contributors

kelvonlys avatar vungods 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.