Skip to content
Benny Thadikaran edited this page Jan 16, 2025 · 9 revisions

Display Help: py init.py -h

Show Version: py init.py -v

Scan stocks using a watchlist file. Pass a file containing stocks (one on each line).

# starts an interactive prompt
py init.py -f nifty_500.csv

See Chart controls on how to navigate charts.

Scan stocks from a list of symbols. Pass a list of symbols space separated.

py init.py --sym tcs astral datapattns

NOTE: If SYM_LIST is specified in user.json, -f or --sym is not required unless you wish to override the default watchlist.

Identify chart patterns on a specific date.:

# iso date format YYYY-MM-DD
py init.py -d 2023-01-01

Save results as images to folder

# default folder is src/images
py init.py --save
# add a custom folder to save images
py init.py --save ~/Desktop/pattern/

To skip the interactive prompt, specify a pattern string:

# Bullish VCP
py init.py -p vcpu

Pattern string can be one of:

Pattern String Description
all All patterns **
bull All Bullish patterns **
bear All Bearish patterns **
bull_harm All Bullish Harmonic patterns
bear_harm All Bearish Harmonic patterns

** Does not include Trendlines, Triangle and Harmonic patterns.

Bullish Patterns

Pattern String Description
vcpu VCP Up
dbot Double Bottom
hnsu Head & Shoulder Up
flagu High Pole and Flag

Bearish Patterns

Pattern String Description
vcpd VCP Down
dtop Double Top
hnsd Head & Shoulder Down
flagd High Pole and Flag

Other Patterns

Pattern String Description
trng Triangles (Symmetric, Ascending, Descending)
uptl UPTrend Lines
dntl DowNTrend Lines

Harmonic Bullish Patterns

Pattern String Description
abcdu Harmonic AB=CD Up
batu Harmonic BAT Up
gartu Harmonic GARTLEY Up
crabu Harmonic CRAB Up

Harmonic Bearish Patterns

Pattern String Description
abcdd Harmonic AB=CD Down
batd Harmonic BAT Down
gartd Harmonic GARTLEY Down
crabd Harmonic CRAB Down

There are other CLI options available for those wanting to tinker.

Chart keyboard navigation

Key Description
n Next Chart
p Previous Chart
NUM_KEY + j Type the number followed by j to jump to index. Press ESC to clear

Chart Plot options

Results of last scan, are saved as json files. Filename is same as pattern string, for E.g. vcpu.json

To plot results of scan, use --plot.

py init.py --plot vcpu.json

To jump to a particular count in the result, use --idx with a count you wish to jump to.

py init.py --plot vcpu.json --idx 15

SAVE_STATE config option

SAVE_STATE config option can be set in user.json. (See Configuration section below). Default is False.

When scanning using a watchlist file, all patterns are tracked in json files stored in src/state folder.

File format is <watchlist_name>_<pattern_name>.json. For e.g. nifty_500_vcpu.json.

Only newly detected patterns are notified and plotted on charts.

To see all currently active patterns in market, use the --plot passing the json file from state folder

py init.py --plot state/nifty_500_vcpu.json

Scanning other Timeframes

By default, only the daily timeframe is scanned. You can specify the timeframe to scan using --tf option.

Assume you have daily stock data.

py init.py --tf weekly

py init.py --tf monthly

py init.py --tf quarterly

If intraday data is configured, you can also scan intraday timeframes.

py init.py --tf 15

py init.py --tf 2h

Multiple config files

While user.json is the default config file. You can define additional config files. For ex. a config file for intraday data or different markets.

Use the -c or --config passing the path to JSON file.

py init.py -c intra_config.json