Package: tti
trading-technical-indicators (tti)Trading Technical Indicators python library, where Traditional Technical Analysis and AI are met. Version 0.2.2 (stable release)Calculate technical indicators (62 indicators supported).Produce graphs for any technical indicator.Get trading signals for each indicator.Trading simulation based on trading signals.Machine Learning integration for prices prediction (not included in this release).Implementation based on the book 'Technical Analysis from A to Z, Steven B. Achelis'. Validation based on the 'A to Z Companion Spreadsheet, Steven B. Achelis and Jon C. DeBry'API documentation and installation instructions can be found in the project's web-site:Trading Technical IndicatorsChange LogStable Releases0.2.2: Incompatibilities with the latest pandas release 1.2.0 fixed (#20)0.2.1: Bug fixes, new pandas release causes an exception in some indicators calculation (#20)0.2.0: First stable release, updates described in the following github issues (#2,#3,#14,#15)Beta Releases0.1.b3: Updates described in the following github issues (#11,#7,#8)0.1.b2: Bugs fixes (#1)0.1.b1: Cosmetic changes in package building file applied (setup.py)0.1.b0: First beta releasePlanned Releases1.0.0: Full featured release, including machine learning related features (planned for 01.03.2021).Indicators supportedAccumulation Distribution LineAverage True RangeBollinger BandsChaikin Money FlowChaikin OscillatorChande Momentum OscillatorCommodity Channel IndexDetrended Price OscillatorDirectional Movement IndexDouble Exponential Moving AverageEase Of MovementEnvelopesFibonacci RetracementForecast OscillatorIchimoku CloudIntraday Movement IndexKlinger OscillatorLinear Regression IndicatorLinear Regression SlopeMarket Facilitation IndexMass IndexMedian PriceMomentumExponential Moving AverageSimple Moving AverageTime-Series Moving AverageTriangular Moving AverageVariable Moving AverageMoving Average Convergence DivergenceNegative Volume IndexOn Balance VolumeParabolic SARPerformancePositive Volume IndexPrice And Volume TrendPrice ChannelPrice OscillatorPrice Rate Of ChangeProjection BandsProjection OscillatorQstickRange IndicatorRelative Momentum IndexRelative Strength IndexRelative Volatility IndexStandard DeviationStochastic Momentum IndexFast Stochastic OscillatorSlow Stochastic OscillatorSwing IndexTime Series ForecastTriple Exponential Moving AverageTypical PriceUltimate OscillatorVertical Horizontal FilterVolatility ChaikinsVolume OscillatorVolume Rate Of ChangeWeighted CloseWilders SmoothingWilliams Accumulation DistributionWilliams %RUsage ExampleCode example"""Trading-Technical-Indicators (tti) python libraryFile name: indicator_example.pyExample code for the trading technical indicators, for the docs.Accumulation Distribution Line indicator and SCMN.SW.csv data file is used."""importpandasaspdfromtti.indicatorsimportAccumulationDistributionLine# Read data from csv file. Set the index to the correct column# (dates column)df=pd.read_csv('./data/SCMN.SW.csv',parse_dates=True,index_col=0)# Create indicatoradl_indicator=AccumulationDistributionLine(input_data=df)# Get indicator's calculated dataprint('\nTechnical Indicator data:\n',adl_indicator.getTiData())# Get indicator's value for a specific dateprint('\nTechnical Indicator value at 2012-09-06:',adl_indicator.getTiValue('2012-09-06'))# Get the most recent indicator's valueprint('\nMost recent Technical Indicator value:',adl_indicator.getTiValue())# Get signal from indicatorprint('\nTechnical Indicator signal:',adl_indicator.getTiSignal())# Show the Graph for the calculated Technical Indicatoradl_indicator.getTiGraph().show()# Execute simulation based on trading signalssimulation_data,simulation_statistics,simulation_graph=\adl_indicator.getTiSimulation(close_values=df[['close']],max_exposure=None,short_exposure_factor=1.5)print('\nSimulation Data:\n',simulation_data)print('\nSimulation Statistics:\n',simulation_statistics)# Show the Graph for the executed trading signal simulationsimulation_graph.show()OutputTechnical Indicator data:
                      adl
Date
1998-10-05  5.346066e+05
1998-10-06  9.788753e+05
1998-10-07  1.377338e+06
1998-10-08  1.251994e+06
1998-10-09  1.108012e+06
...                  ...
2020-11-30  1.736986e+07
2020-12-01  1.741746e+07
2020-12-02  1.737860e+07
2020-12-03  1.741683e+07
2020-12-04  1.742771e+07

[5651 rows x 1 columns]

Technical Indicator value at 2012-09-06: [8617026.854250321]

Most recent Technical Indicator value: [17427706.42639293]

Technical Indicator signal: ('buy', -1)

Simulation Data:
            signal open_trading_action  ... earnings  balance
Date                                   ...
1998-10-05   hold                none  ...        0        0
1998-10-06    buy                long  ...        0  385.138
1998-10-07    buy                long  ...   13.264  411.666
1998-10-08    buy                long  ...   13.264  777.644
1998-10-09    buy                long  ...   19.159  795.329
...           ...                 ...  ...      ...      ...
2020-11-30    buy                long  ...  19817.2  37577.2
2020-12-01   hold                none  ...  19817.2  37577.2
2020-12-02    buy                long  ...  19817.2  38019.2
2020-12-03    buy                long  ...  19817.2  38385.1
2020-12-04    buy                long  ...  19817.2  38837.2

[5651 rows x 7 columns]

Simulation Statistics:
 {'number_of_trading_days': 5651, 'number_of_buy_signals': 4767, 'number_of_ignored_buy_signals': 0, 'number_of_sell_signals': 601, 'number_of_ignored_sell_signals': 0, 'last_stock_value': 475.5, 'last_exposure': 22340.73, 'last_open_long_positions': 40, 'last_open_short_positions': 0, 'last_portfolio_value': 19020.0, 'last_earnings': 19817.21, 'final_balance': 38837.21}Output graphs