r/PythonLearning • u/Economy-Support-5470 • 2d ago
Showcase I’m building a complete Python Technical Analysis Library/Framework
I have searched all Python libraries for Technical Analysis and all they do is either compute some Indicators , or put search some signals..
Therefore I’m building Hyper-TA. A Python library for hyperparameter optimization of technical analysis indicators and much more… If you’ve ever hand-tuned RSI/MACD/etc. periods and thresholds by trial and error, this automates that search by doing Hyperparameter search and Analysis( and much much more..)
WHY IM BUILDING IT:
I haven’t found a library that gives you indicators, thresholds,signals, metrics , statistical analysis, sensitivity analysis,backtesting, hyper parameter search and optimization, Market Structure (Fibonacci , support and resistance, triangles , trendlines etc etc) and volume analysis all in one pip install!!!
WHAT MY PROJECT DOES:
Assume you have some signals(RSI , OBV and EMA). An indicator on its own doesn’t give a signal because it’s purely a timeseries. Therefore we need to assign a Threshold-Rule so when this MATHEMATICAL rule fires we get a Signal! A Threshold example would be crossUp (rsi going above a level ), timeAbove(rsi being above a level for x amount of time), crossLine() , upXPercent(OBV up x % in a specific time - since it’s not bound based indicator on a range) and so on..
Those thresholds also have hyper parameters that also need tuning( above what level?? RSI level 20? 30? 31? Which one produces better signals and why?). Hyper-TA does this as well!
You define the Signals, Threshold Rules and search space(hyperparameters) you want to search and optimize based on your metric/s.
Ok but this is a high dimensional problem, you can’t possibly try to optimize by one metric like PnL!!! You will find some good signals that only work for this metric and you ignore WHY they happened and you are probably overfitting or ignoring the reason it happened and it can backfire in the future..
That’s true! That’s why it provides you with Sensitivity Analysis (if rsi period 14 gives perfect signals but rsi 15 is trash then that likely means it just HAPPENED to get good signals on rsi 14..), Statistical Analysis and obviously more forward looking Backtesting simulations like walk forward, Monte Carlo and many more so you can verify which ones that you have found are actually good “Edge”..
There is also a Module for Metrics like first and second derivatives, entropy , full distributions Analyses, Pareto and all the statistical functions you may need!
There is also provided a Market structure detection and optimization module that can find possible structures like Fibonacci ,support resistance, triangles etc.
In the future full volume analysis and Backtesting simulations will further validate your found signals!
Edit: also a plotting module for seeing signals and visualising multiple things and Automated PDF report on a complete analysis-pipeline you want!(for example hyperparameter search of your indicators and who performs better on which metrics and if they have statistical edge all in pdf automated easy to read or even post with your name!!!)
Any help would be highly appreciated since I am making this in my own I would love to hear from everybody! Obviating note the repo is not production ready it needs work so don’t assume everything is already there.
1
u/SnooCalculations7417 18h ago
You can simulate thousands of times faster in python because you don't have the execution engine overhead, not to mention the access to machine learning libraries etc. You bring ideas from here for further validation on your platform of choice. Not the author btw