Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共4 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:请高手帮忙改下公式

1楼
kingmoonwang 发表于:2012/1/10 0:46:10

请高手帮忙把下面博易的公式改成金子塔的。多谢。

 

MA3:=MA(CLOSE,3);
MA7:=MA(CLOSE,7);
MA14:=MA(CLOSE,14);
RED:=CROSS(C,MA14);
GREEN:=CROSS(MA14,C);

FLAG:=IF(BARSTATUS=1,0,IF(RED,1,IF(GREEN,-1,REF(FLAG,1))));
STICKLINE(FLAG>0,HIGH,MAX(C,O),0,1),COLORRED;
STICKLINE(FLAG>0,LOW,MIN(C,O),0,1),COLORRED;
STICKLINE(FLAG>0,C,O,4,1),COLORRED;
STICKLINE(FLAG<0,HIGH,MAX(C,O),0,0),COLORGREEN;
STICKLINE(FLAG<0,LOW,MIN(C,O),0,0),COLORGREEN;
STICKLINE(FLAG<0,C,O,4,0),COLORGREEN;
STICKLINE(FLAG=0,HIGH,MAX(C,O),0,0),COLORYELLOW;
STICKLINE(FLAG=0,LOW,MIN(C,O),0,0),COLORYELLOW;
STICKLINE(FLAG=0,C,O,4,0),COLORYELLOW;

DRAWICON(FLAG>0 AND CROSS(MA3,MA7),LOW,4),VALIGN0;
DRAWICON(FLAG<0 AND CROSS(MA7,MA3),HIGH,5),VALIGN2;

2楼
jinzhe 发表于:2012/1/10 8:37:01
公式抄错了吧?flag公式定义里面怎么还有个flag
3楼
kingmoonwang 发表于:2012/1/17 23:53:26
没有错啊。博易里就是这样的。请帮忙看下吧。或者能同等实现。多谢了。
4楼
fly 发表于:2012/1/19 9:12:01

//运行模式:逐K线计算

 

variable:FLAG=0;

 

MA3:=MA(CLOSE,3);
MA7:=MA(CLOSE,7);
MA14:=MA(CLOSE,14);
RED:=CROSS(C,MA14);
GREEN:=CROSS(MA14,C);

 

if BARSTATUS=1 then FLAG:=0;

 

if BARSTATUS=0 OR BARSTATUS=2 then
 begin
       if RED THEN
           BEGIN
           FLAG:=1;
           END
       ELSE
           BEGIN
           IF GREEN THEN
                 BEGIN
                 FLAG:=-1;
                 END
           ELSE
                 BEGIN
                 FLAG:=FLAG;
                 END
          END

 end

 

STICKLINE(FLAG>0,HIGH,MAX(C,O),0,1,COLORRED);
STICKLINE(FLAG>0,LOW,MIN(C,O),0,1,COLORRED);
STICKLINE(FLAG>0,C,O,10,1,COLORRED);

STICKLINE(FLAG<0,HIGH,MAX(C,O),0,0,COLORGREEN);
STICKLINE(FLAG<0,LOW,MIN(C,O),0,0,COLORGREEN);
STICKLINE(FLAG<0,C,O,10,0,COLORGREEN);

STICKLINE(FLAG=0,HIGH,MAX(C,O),0,0),COLORYELLOW;
STICKLINE(FLAG=0,LOW,MIN(C,O),0,0),COLORYELLOW;
STICKLINE(FLAG=0,C,O,10,0),COLORYELLOW;

 

DRAWICON(FLAG>0 AND CROSS(MA3,MA7),LOW,4);
DRAWICON(FLAG<0 AND CROSS(MA7,MA3),HIGH,5);

[此贴子已经被作者于2012-1-19 9:12:35编辑过]
共4 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.01172 s, 3 queries.