Skip to main content

Securities Investment Analysis Tools (siat)

Project description

Welcome to the Magic World of siat

Version history

Current version: 3.2 This version unifies the architecture of stock, bond and investment fund together. The unifcation not only makes it convenient to analyze stock, bond and investment fund in same scripts, but also make it easier to construct an investment portfolio with stock, bond and investment fund as components.Version structure: X.Y.Z X is the major version for architecture upgrade only. Y is the functional version for functional enhancement. Z is the minor version just for bug fixing.

What is siat?

siat is a Python plug-in, which stands for security investment analysis toolkit. It is specially designed for teaching and learning purposes on security investment in universities for undergraduate and postgraduate programs.

Quick examples of using siat

from siat import *
Successfully imported siat version 3.2.18

Example 1: Apple stock price for the recent month

apple=security_trend("AAPL")
  Successfully retrieved 774 records for AAPL Apple

png

You may expect to more information, such as price trend in a recent year (MRY), with the high/low point, current price and average price, like below:

apple=security_trend("AAPL", start="MRY",
                     mark_top=True, mark_bottom=True, mark_end=True,
                     average_value=True)
  Successfully retrieved 1023 records for AAPL Apple

png

Example 2: Comparing Price changes among Apple, Microsoft and NVidia

You may expect compare the price changes for the recent quarter (MRQ) for the three stocks. Since there is a major stock split for NVidia in 2024 by 1:10, it is necessary to use adjusted prices (Adj Close) to compare these stock prices.

comp=security_trend(['AAPL','MSFT','NVDA'], 
                    start='MRQ', 
                    indicator='Adj Close', 
                    preprocess='scaling', 
                    mark_top=True, mark_bottom=True, 
                    annotate=True, annotate_value=True)
  Searching for multiple security information for Adj Close, it may take great time ...
  Looking security info for MSFT ...
  Looking security info for AAPL ...
  Looking security info for NVDA ...

png

Example 4: Bollinger band for Apple in the recent quarter

# Script security_technical only supports 4 popular technical indicators: 
# MACD, Bollinger band, KDJ and RSI. 
apple=security_technical("AAPL",
                         technical="Bollinger",
                         start="MRQ",
                         loc1="upper left", loc2="lower right")
  Successfully retrieved 313 records for AAPL Apple
  Smoothening curves ...

png

Example 5: CCI for Apple in recent quarter

# Script security_technical2 supports about 20 popular technical indicators in Dehong-style graph: 
apple=security_technical2("AAPL",
                         technical="CCI",
                         start="MRM",
                         loc1="upper left", loc2="lower right")
  Successfully retrieved 185 records for AAPL Apple

png

What sorts of security product does siat support?

  1. Public company profile: world-wide
  2. Stock & stock market index: world-wide
  3. Stock valuation: primarily in China (mainland and HK) and the U.S.
  4. Stock option chain: primarily in the U.S.
  5. Bond: primarily in China and the U.S.
  6. Markowitz portfolio: with all the supported stocks and bonds
  7. Fund: primarily in China and the U.S.
  8. Futures: primarily in China and the U.S.
  9. Options: primarily in China and the U.S.
  10. Digital currency: world-wide (some may be restricted by data sources)
  11. Balance sheet: in China (full function) and world-wide (basic function)
  12. Income statement: in China mainland (full function) and world-wide (basic function)
  13. Cash flow statement: in China mainland (full function) and world-wide (basic function)
  14. Du Pont Identity: world-wide
  15. Sector trend and valuation: primarily in China

What sorts of analytical methodology does siat support?

  1. Trend analysis
  2. Panel comparation
  3. Return analysis: rolling returns, holding period returns
  4. Risk analysis: rolling volatility, holding period volatility, LPSD
  5. Technical analysis: more than 15 indicators
  6. Risk-adjusted return: sharpe, sortino, treynor, Jensen alpha
  7. Portfolio optimization: four risk-adjusted returns
  8. CAPM beta trend
  9. Beta adjustments: simple adjustment, Scholes-Williams, Dimson
  10. Beta leverage: Hamada Model
  11. Fama-French three-factor model
  12. Fama-French-Carhart four-factor model
  13. Fama-French five-factor model
  14. Future pricing
  15. Option pricing: European style, American style, with/without dividends
  16. VaR & ES: variance-covariance, historic simulation, Monte Carlo, multiple periods
  17. Liquidity risk: Roll spread, Amihud, Pastor-Stambaugh
  18. ESG: basic functions

Do I have to download data first before using siat?

NO! siat will search the internet data sources for all the required data during analysis. The main data sources siat uses:

  1. Yahoo Finance
  2. Sina Finance
  3. East Money
  4. Stooq (Polish)
  5. FRED
  6. OECD
  7. IMF
  8. Shanghai Stock Exchange
  9. Shenzhen Stock Exchange
  10. Tokyo Stock Exchange
  11. HKEX
  12. Sustainalytics

Thanks the above websites for their valuable data supply!

How to install siat?

The author strongly recommends using siat together with Jupyter Notebook or Jupyter Lab in Anaconda. In order to install siat for the very first time, open a Jupyter Notebook, and type in the following command: !pip install siat

If the above method does not work, something might be wrong in your Python path settings. Try to open an Anaconda Prompt in Windows or a Terminal App in Mac or Linux, and type in the following command: pip install siat

How to upgrade siat?

In Jupyter Notebook or Jupyter Lab: upgrade_siat()

If you suffer from slow internet connection (often in campus classrooms with many students), try to use alternative sources, such as: upgrade_siat(alternative="tsinghua") upgrade_siat(alternative="alibaba")

If the above methods do not work for you, you have to goto the traditional ways to use command-line script, such as: pip install --upgrade siat

Are there more detailed case studies on using siat?

YES! There are hundreds of video case studies in the author's channel (most in Chinese, some in English). https://space.bilibili.com/284812153 Welcome to follow the channel!

How to report a bug or look for help?

Write to the author, Prof. WANG Dehong, wdehong2000@163.com



          

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

siat-3.2.19-py3-none-any.whl (2.1 MB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page