Skip to content

algo21-220040079/Assignment3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a7e1a10 · May 9, 2021

History

5 Commits
May 9, 2021
May 9, 2021

Repository files navigation

Assignment3

Ref:《资金流量指标MFI》http://www.360doc.com/content/09/0420/11/32668_3197857.shtml

Momentum indicator is a technical indicator that uses the principle of dynamics to study trends and reverse phenomena in the process of transformation. As time becomes smaller and the changing speed and energy gradually slow down, the market may transform. Common momentum indicators include ADX, CMO, MACD, RSI, KDJ, Momentum Index (MOM) and William indicator.

Recently I have seen a relatively rare momentum indicator called Money Flow Index (MFI). The MFI was proposed by JWelles Wilder's in March 1989, which combined consideration of price and volume, and was equivalent to the RSI indicator of trading volume. Generally speaking, the increase in price increase and the decrease in price decrease are an inertial effect. When the stock price rises in a wave, the transaction volume must increase with it.

The Shanghai Composite Index from 2009 to now and the MFI that I calculate is shown below: Figure_1-3

Calculation method

  1. Typical price (TP) = the arithmetic average of the highest price, lowest price and closing price of the day

  2. Currency flow (MF) = typical price (TP) × N day trading volume

  3. If the current day's MF>yesterday's MF, then the current day's MF value is regarded as positive currency flow (PMF)

  4. If the MF of the day is less than the MF of the yesterday, the MF value of the day will be regarded as negative currency flow (NMF)

  5. MFI=100-[100/(1+PMF/NMF)]

  6. The parameter N is generally set to 14 days.

Application rule

  1. Displaying overbought and oversold is the most basic function of the MFI indicator. When MFI>80, it is overbought. When it goes back and breaks below 80, it is a short-term selling opportunity.

  2. When MFI<20, it is oversold. When it breaks through 20, it is a short-term buying opportunity.

  3. When MFI>80 and divergence occurs, it is regarded as a sell signal.

  4. When MFI<20 and a deviation occurs, it is regarded as a buy signal.

Figure_1 Figure_1-1 Figure_1-2 The following is a historical backtest of different parameter combinations and time intervals. It is not difficult to find from the figures below that the 20/80 oversold and overbought signals are not ideal. When the overbought value is changed to 90, results get obviously better. In addition, the MFI backtesting effect since 2016 is relatively good, especially when the overbought value is changed to 90, and the backtesting effect since 2000, 2005 or 2009 may not be as good as the market, reflecting the longer the time period, the MFI The worse the effect of the indicator, in fact, the MFI indicator is a technical indicator that provides short- and medium-term trading signals.

  • 2009 to now, overbought:80, oversold:20Figure_1-4
  • 2009 to now, overbought:90, oversold:20Figure_1-5
  • 2009 to now, overbought:95, oversold:20Figure_1-6
  • 2009 to now, overbought:95, oversold:30Figure_1-7
  • 2009 to now, overbought:95, oversold:15Figure_1-8
  • 2016 to now, overbought:90, oversold:20Figure_1-9

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages