Python implementation of Lorentzian Classification algorithm.
Project description
This module is a python implementation of Lorentzian Classification algorithm developed by @jdehorty in pinescript. The original work can be found here - https://www.tradingview.com/script/WhBzgfDu-Machine-Learning-Lorentzian-Classification/
Prerequisites
Ensure that TA-Lib is downloaded and built for your platform. Set
TA_INCLUDE_PATH
andTA_LIBRARY_PATH
as mentioned in ta-lib-python. TA-Lib package itself will be installed as a dependency ofadvanced-ta
.
Usage
At the most simplest, you can just do this:
from advanced_ta import LorentzianClassification
.
.
# df here is the dataframe containing stock data as [['open', 'high', 'low', 'close', 'volume']]. Notice that the column names are in lower case.
lc = LorentzianClassification(df)
lc.dump('output/result.csv')
lc.plot('output/result.jpg')
.
.
For advanced use, you can do:
from advanced_ta import LorentzianClassification
import TA-Lib as ta
.
.
# df here is the dataframe containing stock data as [['open', 'high', 'low', 'close', 'volume']]. Notice that the column names are in lower case.
lc = LorentzianClassification(
df,
features=[
LorentzianClassification.Feature("RSI", 14, 2), # f1
LorentzianClassification.Feature("WT", 10, 11), # f2
LorentzianClassification.Feature("CCI", 20, 2), # f3
LorentzianClassification.Feature("ADX", 20, 2), # f4
LorentzianClassification.Feature("RSI", 9, 2), # f5
ta.MFI(df['open'], df['high'], df['low'], df['close'], df['volume']) #f6
],
settings=LorentzianClassification.Settings(
source='close',
neighborsCount=8,
maxBarsBack=2000,
showDefaultExits=False,
useDynamicExits=False
),
filterSettings=LorentzianClassification.FilterSettings(
useVolatilityFilter=True,
useRegimeFilter=True,
useAdxFilter=False,
regimeThreshold=-0.1,
adxThreshold=20
))
lc.dump('output/result.csv')
lc.plot('output/result.jpg')
.
.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
advanced-ta-0.1.2.tar.gz
(13.3 kB
view hashes)
Built Distribution
Close
Hashes for advanced_ta-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ddae874d14c3ef1b3ed2124cb6799819aaf27b33fa5280a7e5dd9077e6db36f |
|
MD5 | 0e222fe9d3d45b6aac3118d44a38aa76 |
|
BLAKE2b-256 | 1ea845768714a172b4a5f2fb19a86353faea325236bf1c1edcf69e0e40c2fd83 |