⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 msxindexrsiwavlete.asv

📁 用matlab实现股票分析中的RSI指标
💻 ASV
字号:
clear all
nn=1075 %数据长度
mm=0
% mm=0  %delay plots of initial satate
delay=0
aa1=xlsread('e:\datafix\masangx\compdefs_temp.xls')

aa3=aa1(1:nn,29)   %取第29列数据

%小波分解和重构
[C2,L2] = wavedec(aa3,5,'sym5')
aa5=wrcoef('a',C2,L2,'sym5',5)

%求活载效应
dd=aa3-aa5
zz3=dd.'

%求控制线
tt=1:nn-mm-delay
mean1=0
macd(tt)=0
vdd1(tt)=0
vdd2(tt)=0
trma(tt)=0

% n为周期点数
n=144
m=1



for tt=1:nn-mm-delay-1
  vdd1(tt)=dd(tt+1)-dd(tt)
end

for tt=(n+1):m:nn-mm-delay-1
    vdd3=0
    vdd4=0
   for tt1=1:n
    if vdd1(tt-tt1)>0
       vdd3=vdd3+vdd1(tt-tt1)
   else
       vdd4=vdd4+vdd1(tt-tt1)
   end
  end 

vdd2(tt)=100*vdd3/(vdd3+abs(vdd4))

end

subplot(2,1,1)   %rsi指标显示
plot(dd,'b')
subplot(2,1,2)  %rsi指标显示
tt=n+1:nn-mm-delay-1
plot(tt,vdd2(n+1:nn-1),'b')
% plot(vdd2,'b')

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -