『最佳拍檔』智能決策系統

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 2898|回复: 5

编写Metastock 公式疑问

[复制链接]
发表于 2009-6-21 20:53:19 | 显示全部楼层 |阅读模式

请教怎样改成以下公式。

Mov(CLOSE,3,E);Mov(CLOSE,5,E);Mov(CLOSE,8,E);Mov(CLOSE,10,E);Mov(CLOSE,12,E);

Mov(CLOSE,15,E);Mov(CLOSE,30,E);Mov(CLOSE,35,E);Mov(CLOSE,40,E);Mov(CLOSE,45,E);

Mov(CLOSE,50,E);Mov(CLOSE,60,E);

Smoothed Moving Average (SMMA)Smoothed Moving Average (SMMA)
The first value of this smoothed moving average is calculated as the simple moving average (SMA):

SUM1 = SUM(CLOSE, N)SMMA1 = SUM1/N
The second and succeeding moving averages are calculated according to this formula:

PREVSUM = SMMA(i-1) *NSMMA(i) = (PREVSUM-SMMA(i-1)+CLOSE(i))/N
Where:
SUM1 — is the total sum of closing prices for N periods;
PREVSUM — is the smoothed sum of the previous bar;
SMMA1 — is the smoothed moving average of the first bar;
SMMA(i) — is the smoothed moving average of the current bar (except for the first one);
CLOSE(i) — is the current closing price;
N — is the smoothing period.

谢谢!

发表于 2009-7-3 23:14:27 | 显示全部楼层

上面的問題, 好似剪貼後掽合起一樣,
似問非問, 似公式非公式........ 
勁 ~~


上面那埋想怎樣的???   中途斷開就接入 ...........Smoothed Moving Average (SMMA)Smoothed Moving Average (SMMA)......


"Mov(CLOSE,3,E);Mov(CLOSE,5,E);Mov(CLOSE,8,E);Mov(CLOSE,10,E);Mov(CLOSE,12,E);


Mov(CLOSE,15,E);Mov(CLOSE,30,E);Mov(CLOSE,35,E);Mov(CLOSE,40,E);Mov(CLOSE,45,E);


Mov(CLOSE,50,E);Mov(CLOSE,60,E);"


 SUM1 = SUM(CLOSE, N)SMMA1 = SUM1/N  ?????????


 


 


 咁樣........ 我無法明你想點架喎..............

发表于 2009-7-3 23:16:52 | 显示全部楼层

你睇我都從網上抄了類似的資料:
http://www.metaquotes.net/techanalysis/indicators/moving_average



 


Smoothed Moving Average (SMMA)


The first value of this smoothed moving average is calculated as the simple moving average (SMA):


SUM1 = SUM(CLOSE, N)
SMMA1 = SUM1/N


The second and succeeding moving averages are calculated according to this formula:


SMMA(i) = (SUM1-SMMA1+CLOSE(i))/N


Where:
SUM1 — is the total sum of closing prices for N periods;
SMMA1 — is the smoothed moving average of the first bar;
SMMA(i) — is the smoothed moving average of the current bar (except for the first one);
CLOSE(i) — is the current closing price;
N — is the smoothing period.


 


 

发表于 2009-7-3 23:35:12 | 显示全部楼层

"Mov(CLOSE,3,E);Mov(CLOSE,5,E);Mov(CLOSE,8,E);Mov(CLOSE,10,E);Mov(CLOSE,12,E);


Mov(CLOSE,15,E);Mov(CLOSE,30,E);Mov(CLOSE,35,E);Mov(CLOSE,40,E);Mov(CLOSE,45,E);


Mov(CLOSE,50,E);Mov(CLOSE,60,E);"

除這一埋唔知你想問乜以外, 其它的只要簡單的跟著所須要的條件一一輸入便可以做到 !!

{Smoothed Moving Average (SMMA)}
nDay     :=Input("Please enter the N periods:",1,1000,10);
SUM1    :=Sum(CLOSE,nDay);
SMMA1 :=SUM1 /nDay;
SMMA   :=(SUM1-SMMA1+CLOSE)/nDay;
SMMA


 


完成 - 可以調較 N periods 的 SMMA 技術指標 !!


 


Q&A_SMMA.gif


 


Q&A_SMMA2.gif

 楼主| 发表于 2009-7-12 19:14:09 | 显示全部楼层
谢谢
发表于 2009-7-22 20:32:49 | 显示全部楼层
謝謝樓主提供給我學習
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|Archiver|『最佳拍檔』智能決策系統

GMT+8, 2024-9-27 22:46 , Processed in 0.063871 second(s), 22 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表