Algo(Trading)

Stock Technical Analysis Optimal Value Calculation Site_Calculation Method

This article is Google’s automatic translation from Japanese.

The following is a detailed explanation of the calculation method used in the “Stock Technical Analysis Optimal Value Calculation Site,” a site I created myself.

Required prerequisite knowledge

It is written on the assumption that you know the technical analysis of stock trading.

Even if you don’t know it, it’s not a difficult concept, so please search it online before reading it.

Revenue calculation settings

It is calculated with the following settings.

  • Use daily chart (technical analysis at closing price)
  • Long only. (Enter from “Buy”.)
  • Repeat transactions in the order of “buy”-> “sell”-> “buy”-> “sell”. In other words, even if the “buy” timing occurs after the “buy”, it is ignored (sell is the same).
  • “Sell” sells all the stocks purchased by “Buy”.
  • The amount of “buy” is set to the same amount each time

How to calculate the rate of return

Percentage of total transaction profit / loss during the trading period

See the figure below for a specific example.

The transaction period (calculation period) can be selected from 50, 100, and 200 days .

Also, if the end ends with a “buy”, that last transaction will not be considered for earnings.

Setting each analysis_transaction timing

In each analysis, I think there are various ways of thinking about transaction timing.

We will introduce each analysis method calculated on this site.

RSI

Calculated parameters
  • Length: Calculated between 5 and 20
  • Upper_Band value (upper limit): Calculated between 65 and 75
  • Lower_Band value: Calculated between 25 and 35

“Buy” and “Sell” timing settings

  • Buy: When the RSI falls below the Lower_Band and then rises above the Lower_Band again
  • Sell: When the RSI surpasses Upper_Band and then falls below Upper_Band again

As shown in the figure, it is as follows.

BB (Bollinger Bands)

Calculated parameters
  • Length: Calculated between 5 and 50
  • StdDev (standard deviation): Calculated between 1.1 and 3.5 (calculated in 0.1 increments)

“Buy” and “Sell” timing settings

  • Buy: The timing when BB falls below the lower limit of the band and then rises above the lower limit of the band again.
  • Sell: When BB exceeds the band upper limit and then falls below the band upper limit again

As shown in the figure, it is as follows.

MACD

Calculated parameters
  • Fast_Period (Short-term EMA period): Calculated between 3 and 14
  • Slow_Period (long-term EMA period): Calculated between 15-40
  • Signal_Period: Calculated between 3 and 15

“Buy” and “Sell” timing settings.

  • Buy: Timing when MACD < MACD signal < 0 changes to 0 > MACD > MACD signal
  • Sell: Timing from the state of MACD > MACD signal > 0 to 0 < MACD < MACD signal

As shown in the figure, it is as follows.

EMA (Exponential Moving Average)

Calculated parameters
  • Fast_Period (Short-term EMA period): Calculated between 5 and 14
  • Slow_Period (long-term EMA period): Calculated between 15 and 30

“Buy” and “Sell” timing settings

  • Buy: Short-term EMA < From long-term EMA status to short-term EMA > Long-term EMA
  • Sell: Short-term EMA > Timing from long-term EMA to short-term EMA < long-term EMA

As shown in the figure, it is as follows.