以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://222.73.7.161/bbs/index.asp)
--  公式模型编写问题提交  (http://222.73.7.161/bbs/list.asp?boardid=4)
----  帝那波利趋势代码  (http://222.73.7.161/bbs/dispbbs.asp?boardid=4&id=5382)

--  作者:KKSH
--  发布时间:2011/3/7 15:11:52
--  帝那波利趋势代码

 

{UP}
C>=Ref(Mov(C,3,S),-3) AND
(Mov( CLOSE, 8.3896, E) - Mov( CLOSE, 17.5185, E))>=
(PREV+(0.199*((Mov( CLOSE, 8.3896, E) - Mov( CLOSE, 17.5185, E))-PREV))) AND
(Mov( CLOSE, 8.3896, E) - Mov( CLOSE, 17.5185, E))>=
Ref((Mov( CLOSE, 8.3896, E) - Mov( CLOSE, 17.5185, E)),-1)

 

{DOWN};
C<=Ref(Mov(C,3,S),-3) AND
(Mov( CLOSE, 8.3896, E) - Mov( CLOSE, 17.5185, E))<=
(PREV+(0.199*((Mov( CLOSE, 8.3896, E) - Mov( CLOSE, 17.5185, E))-PREV))) AND
(Mov( CLOSE, 8.3896, E) - Mov( CLOSE, 17.5185, E))<=
Ref((Mov( CLOSE, 8.3896, E) - Mov( CLOSE, 17.5185, E)),-1){jimt};


--  作者:fly
--  发布时间:2011/3/7 16:02:54
--  
楼主的MOV函数和PREV和E都是什么意思,看不懂
[此贴子已经被作者于2011-3-7 16:03:05编辑过]

--  作者:KKSH
--  发布时间:2011/3/7 16:43:07
--  

MOV就是移动平均线,最后是E的话是EMA的意思,是S的话是SMA的意思,这个是确定的

 

PREV是类似公式重复计算前一根的意思

 

 

[此贴子已经被作者于2011-3-7 16:53:19编辑过]

--  作者:KKSH
--  发布时间:2011/3/7 16:43:23
--  
Metastock的语法
--  作者:KKSH
--  发布时间:2011/3/7 16:54:05
--  

PREV
The PREV constant allows you to create self-referencing formulas.  A self referencing formula is one that is able to reference the "previous" period\'s value of itself.
For example, the following is an example of a self referencing formula:
((H+L+C)/3) + PREV
This simple formula divides the high, low, and closing prices by 3 and then adds this value to yesterday\'s value of the ((H+L+C)/3).
The calculation of the popular indicator On Balance Volume illustrates the use of the PREV function.

(if(c>ref(c,-1),1,-1)*volume)+PREV
Although On Balance Volume can be calculated without the use of the PREV function, an exponential moving average cannot (other than using the mov() function).  The following formula shows how a 18% exponential moving average (approximately 10-periods) is calculated using the PREV function.
(close*0.18)+(PREV*0.82)


--  作者:manbutianya
--  发布时间:2011/11/1 23:24:00
--  
 请版主把它转换成金字塔代码看看效果。
--  作者:fly
--  发布时间:2011/11/2 9:12:31
--  

MOV就是移动平均线,最后是E的话是EMA的意思,是S的话是SMA的意思,这个是确定的

 

EMA(CLOSE,N)----这里的N需是正整数

SMA(CLOSE,N,M)---这里的N和M需是正整数,且N>M

 

而楼主的很明显是带有四位小数的浮点数,很抱歉不能改为金字塔的语言.