A Multivariate Approach Towards Simplifying Financial Markets With Python

Dev Juneja
6 min readApr 22, 2023

There are already numerous projects available that claim to simplify markets through automation. However, I believe there are few that will provide a complete picture (not only about a certain module) of the entire project modules in one location.
Fin-Maestro is a web application that I designed with the purpose of covering all modules under one roof. If you find the project interesting, indicate your support for it by dropping a star on GitHub; it greatly motivates me.

So let us begin by learning a little about Fin-Maestro before delving into what it accomplishes.

What is Fin-Maestro?

Fin-Maestro is a cutting-edge web application that aims to make it easier for market participants to operate more effectively and intelligently by thoroughly examining various parameters of various financial instruments.

Modules of Fin-Maestro:

  1. Valuation Determiner
  2. Mock Trader
  3. Sentiment Analyzer
  4. Pattern Analyzer
  5. Indices Health
  6. SWOT Analyzer
  7. Fundamental Scans
  8. Crypto Technical Scans
  9. Strategy Backtester
  10. Buy/Sell Signals Generator
Fin-Maestro Demo Dashboard

Let us begin by learning the functionality of each Fin-Maestro module as simply as possible.

1. Valuation Determiner

The Valuation Determiner considers a variety of the stock’s financial factors before calculating its fair value using the book value, yearly sales, annual earnings, and Graham number. It determines if the stock is undervalued, reasonably valued, or overvalued after the computation is complete.

Input: 
1. Stock Name

Output:
1. Valuation as per book value (VAP_BV)
2. Valuation as per annual sales (VAP_SALES)
3. Valuation as per earnings (VAP_EARNINGS)
4. Valuation as per Graham number (VAP_GRAHAM)
5. Status: Undervalued / Fairly Valued / Overvalued

Unique Aspect of Valuation Determiner module:

For equities from various sectors, a separate procedure is utilized to determine the fair value. The Valuation Determiner module automatically modifies the stock’s fair value computation process to produce enhanced dependability and accuracy.

Reason:
Some stocks tend to trade at higher multiples due to it’s nature of the business. Example: FMCG Stocks, monopoly/duopoly stocks. Thus, if such stocks are not differentiated, the result obtained would always indicate that stock is overvalued. This may result in missed chances to add companies to your portfolio at the right time.

Valuation Determiner Module

2. Mock Trader

Without using real money for trading, market participants can place simulated trades using Mock Trader. Participants in the market might use these trades to test a certain trading strategy or analysis.

Input: 
1. Stock Name
2. Transaction type: Buy/Sell

Output:
1. Trading position in the requested stock.
Mock Trader

3. Sentiment Analyzer

The Sentiment Analyzer module analyses option chain data for indices and securities to produce a sentiment that indicates whether the index or stock is oversold, slightly oversold, slightly overbought, or overbought. It also particularly involves analysis of PCR (Put Call) ratio to arrive at conclusions.

Input: 
1. Stock Name

Output:
1. Sentiment for Nifty and Bank Nifty (needs no user input)
2. Sentiment for requested stock (oversold, slightly oversold, slightly overbought, or overbought)
Sentiment Analyzer

4. Pattern Analyzer

Finding a certain technical chart pattern across all the stocks is done by the Pattern Analyzer module, which then outputs the stock name and a chart showing the pattern’s position with a yellow pointer just above it. Also, it can exclude equities whose technical charts show a breakdown, breakout, or consolidation.

Input: 
1. Technical pattern name

Output:
1. Candlestick chart of stocks where the pattern is located indicating the target pattern's position with yellow pointer.
2. List of stocks that witnessing consolidation, breakout or breakdown.
Pattern Analyzer

5. Indices Health

This module employs a color-coded system to show the overall valuation status of all NSE indices. It makes use of the hues red, orange, and green. Green means that the valuations are good enough to begin SIPs, while orange and red indicate that the valuations are neutral and expensive respectively.

Output:
1. List of indices that are colored-wrapped
Indices Health

6. SWOT Analyzer

This module examines a stock’s technical parameters and fundamentals before generating a SWOT that lists the stock’s strengths, weaknesses, opportunities, and threats.

Inputs:
1. Stock name

Output:
1. SWOT for the requested stock.
SWOT Analyzer

7. Fundamental Scans

This module examines the financial data of the stocks and sorts stocks that are attractive according to their Graham number, book value, annual sales, and earnings.

Output:
1. List of stocks attractive as per its book value.
2. List of stocks attractive as per its sales.
3. List of stocks attractive as per its earnings.
4. List of stocks trading below Graham Number.
Fundamental Scans

8. Crypto Technical Scans

For traders’ convenience, this module analyses the technical charts of the specified cryptocurrency and then generates a plot showing the automatically generated support and resistance levels for that cryptocurrency.

Inputs:
1. Cryptocurrency name

Output:
1. List of stocks attractive as per its book value.
2. List of stocks attractive as per its sales.
3. List of stocks attractive as per its earnings.
4. List of stocks trading below Graham Number.
Crypto Technical Scans

9. Strategy Backtester

For any requested stock, this module now backtests a hardcoded trading strategy and generates a visually appealing report with information on the number of trades, total returns, maximum drawdown, and average return.

Inputs:
1. Stock name

Output:
1. A plot indicating the backtest results for the requested stock.
Strategy Backtester (Basic EMA Crossover strategy example)

10. Buy/Sell Signals Generator

For any requested stock, this module produces a visually appealing plot with long/short green and red colored markers respectively as signals. These signals can be used to interpet the further direction of the stock.

Inputs:
1. Stock name
2. Number of signals (total number of buy or sell signals that must be plotted)

Output:
1. A visually appealing plot indicating buy and sell signals for the requested stock.
Signals Generator

Is this web application code ready?

Yes, it is. Visit our GitHub page by the link below and checkout the entire source code of Fin-Maestro. Do star the project if it grabbed your attention. It really motivates me to do better.

Disclaimer:

  • DO NOT use the results provided by the web app ‘solely’ to make your trading/investment decisions.
  • Always backtest and analyze the stocks manually before you trade.
  • Consult your financial advisor before making any trading/investment decisions.
  • The authors/contributors or the web app will not be held liable for your losses if any.

--

--

Dev Juneja

I am a financial tinkerer and have been trading for the past 8 years, in addition to having an interest in the field of software development.