Coder Social home page Coder Social logo

uelel / createpatterns Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 1.0 3.66 MB

Python Flask/D3.js application providing fast and easy way to graphically extract patterns from candlestick (OHLC) data

License: MIT License

Jupyter Notebook 94.43% Python 0.80% CSS 1.08% JavaScript 3.53% HTML 0.15%

createpatterns's Introduction

createPatterns

Python 3.8.3 Flask 1.1.1 D3.js v5 Bootstrap 4.1.3

This Python Flask/D3.js application provides fast and easy way to graphically extract patterns from candlestick (OHLC) data.


Features

  • bullish (1) / bearish (-1) / neutral (0) patterns can be easily marked in a dynamic candlestick plot

  • Marked patterns are saved to provided JSON file with format:

    {
       "startDt": "2019-09-09T10:16:00.000Z",
       "stopDt": "2019-09-09T10:36:00.000Z",
       "dir": "-1"
    }

    where startDt and stopDt define pattern timespan (both limits are inclusive).


Usage

1. Bind your OHLC data

Sample interfaces from file, influxdb are currently implemented.
Actual loading methods can be found in dataLoad.py.
Check the implementation details to grap the whole concept.

Or implement your own interface

  • Actual methods for data loading are implemented in ./dataLoad.py

    These methods should follow the required structure.

    Required parameters:

    • dtLimit: %Y-%m-%dT%H:%M:%SZ datetime string that delimits given data interval
    • direction: ('left', 'right') string defining direction from dtLimit
    • noCandles: int defining number of candles to be loaded per request
    • others: other user-defined parameters

    Required return object:

    • pd.DataFrame with ['Date', 'Open', 'High', 'Low', 'Close'] columns
    • Date column contains parsed datetimes
    • rows are sorted by ascending Date column
    • unknown candles starts with Date followed by np.nan values

  • Loading methods must be referenced in ./data.py together with others parameters

2. Start the app

python run.py

3. Set up the environment

Parameter Comment
Loading method File / InfluxDB / Your own interface
Datafile / Database Path to file / Database name
Initial date and time .. to use in data loading
Pattern file (Non)empty JSON file to use for saving pattern positions
Fixed pattern length If enabled, patterns contain only defined number of candles
Number of displayed candles
Number of minutes between x ticks
y-axis range
y-axis step
y-labels precision

4. Browse OHLC data and mark your desired patterns!


License

This project is licensed under the terms of the MIT license.

createpatterns's People

Contributors

uelel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

eslamx7

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.