Skip to content

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

License

Notifications You must be signed in to change notification settings

uelel/createPatterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published