Package: market-analy
market_analyA python package for interactive charting and analysis of financial instruments.Functionality includesdefining and visualising trends.Interactive charting is offered via guis created from widgets of thebqplot,ipywidgetsandipyvuetifylibraries. Users can use the underlying parts to develop their own interactive charts and analyses. Contributions very much welcome! This is a WIP and it's anticipated that further analyses will be added.There's a load of great financial libraries out there. This library isn't reinventing the wheel (not intentionally anyway), rather it principally provides functions and interactive charting that I think are useful and couldn't find elsewhere.Video tutorialsThe following videos cover what's on offer:General tutorialdemonstrates the functionality as of the initial release (February 2023).Trendsdemonstrates functionality (added June 2023) to define and visualise trends.QuickstartAll analyses can be accessed via the classesAnalysis(single instrument analyses) andCompare(to compare multiple instruments). For example:frommarket_pricesimportPricesYahoofrommarket_analyimportAnalysis,Compareprices=PricesYahoo("MSFT")# OR if Yahoo API endpoints are not all currently available in your region...prices=PricesYahoo("MSFT",calendars="XNYS",delays=0)analy=Analysis(prices)gui=analy.plot(days=30)https://user-images.githubusercontent.com/56914820/220773777-df0d0bec-bbe1-45bb-b067-d679666450cd.mp4trend_kwargs={"prd":60,"ext_break":0.05,"ext_limit":0.03,"min_bars":5,}gui=analy.trends_chart("1D",trend_kwargs,years=3,)https://github.com/maread99/market_analy/assets/56914820/998c7f46-20f5-43f1-8b82-c857c0702ceecomp=Compare(PricesYahoo("MSFT, AMZN, TSLA"))# OR if Yahoo API endpoints are not all currently available in your region...comp=Compare(PricesYahoo("MSFT, AMZN, TSLA",calendars="XNYS",delays=0))gui=comp.plot(hours=30)https://user-images.githubusercontent.com/56914820/220773790-1fdabf13-25bb-4205-acc2-6bac9b832dae.mp4gui=comp.chg_every_interval("20T",days=5,chart=True)https://user-images.githubusercontent.com/56914820/220773802-ae329259-4a4e-4e5e-8d02-d4ee88b8b452.mp4For further documentation see thevideo tutorialsand theanalysismodule.Installation and environmentIt's recommended thatmarket-analyis installed to a new virtual environment created usingvenv.The package can be installed to the activated environment via pip:$ pip install market-analyPlots are intended to be created in JupyterLab (they will not load in a notebook opened in VSCode). The 'jupyter' optional dependencies can be specified to additionally installjupyterandjupyterlabto the target environment.$ pip install market-analy[jupyter]Alternatively, it's possible to use an existing JupyterLab installation (>=3.0) in a separate environment to that in whichmarket_analyis installed. In this case:The following dependencies should additionally be installedin the environment to which JupyterLab is installed:ipyvuetifybqplotA kernel should be created forthe environment to whichmarket_analywas installed. Executing the following, with any virutal environment activated, will create a kernel and make it available to all installed versions ofjupyterlab.python -m ipykernel install --user --name mkt_analy --display-name "market analy env":warning: If starting JupyterLab from a different environment to the environment in whichmarket_analyis installed thenthe same versions ofipyvuetifyandbqplotmust be installed to both environments. If either of these packages is subsequently upgraded in one environment then it must also be upgraded in the other. (This is due to the potential for conflicts between the versions in the JupyterLab environment, which are responsible for the frontend, and those in themarket_analyenvironment where the backend is defined.)Color schemeThe color scheme assumes the package is being used with the JupyterLab dark theme. There are no plans to provide a 'light theme' option (although a contribution would certainly be welcome from anyone seeking one).market-pricesdependencymarket-analydepends on themarket-priceslibrary for price data. This provides for functionality including:defining analysis periods in terms of number of sessions and trading minutes rather than calendar days and times.complete data sets regardless of liquidity (regular data points during market hours, no data points outside of market hours).Most of the arguments available to the market-pricesgetfunction can be passed directly to themarket_analyfunctions. See themarket-pricesdocumentation for further info.Release schedule, bugs, development and feedbackThe first beta version ofmarket_analywas released Feb 2023. Functionality to  define and visually interrogate trends was added in June 2023.The project is immature. Whilst it's not anticipated that major changes will be made to the existing public side, they could be. All that's under-the-bonnet is subject to change as the project evolves. Theguismodule in particular won't permit much further development without overhauling the current inheritance-based approach to a compositional one.The test suite is somewhat limited. It's pretty much guaranteed that there are bugs. Please raise anissueif you find one or come across unexpected behaviour.Please usediscussionsto make any suggestions and offer general feedback.Disclaimersmarket-analyshould not be assumed sufficiently reliable to undertake analysis intended to inform investment decisions. Users should inspect the source code and the test suite of the library and its dependencies in order to make their own assessment of the packages' suitability for their purposes.Themarket-analypackage is used entirely at the user's own risk.The defaultmarket_prices.PricesYahooclass gets data from publically available Yahoo APIs.See theDisclaimers section of the market-prices READMEfor conditions of use, including restrictions.Alternative packagesawesome-quantoffers an extensive listing of libraries for all things finance.LicenseMIT License