以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  有行情指标。求编写自动交易  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=10357)

--  作者:st2199
--  发布时间:2012/3/1 10:36:31
--  有行情指标。求编写自动交易
VAR2:=CLOSE*VOL; 
MID:=EMA((EMA(VAR2,3)/EMA(VOL,3)+EMA(VAR2,6)/EMA(VOL,6)+EMA(VAR2,12)/EMA(VOL,12)+EMA(VAR2,24)/EMA(VOL,24))/4,13); 
主趋势线1:MID;MID2:=MID*1.01;
SDN:=MID*0.94; 
SDN3:=REF(CLOSE,1800),COLORYELLOW;
SUP:=1.06*MID,COLORBLUE; 
VAR4:=EMA(CLOSE,9); 
B9:=COUNT(HIGH>SUP,5);
VAR1:=MID;
PARTLINE(VAR1>REF(VAR1,1),VAR1),LINETHICK2,COLORRED;
PARTLINE(VAR1<REF(VAR1,1),VAR1),LINETHICK2,COLORCYAN;
PP:=(2*CLOSE+HIGH+LOW)/4;
QQ:=ABS(PP-MA(CLOSE,13*15));
AA:=QQ/MA(CLOSE,13*15);
N2:=(13-2)*15;
N3:=(13+2)*15;
N4:=(13+3)*15;
主趋势线:=(MA(CLOSE,13)),LINETHICK2,COLORRED;
CC:=(CLOSE/主趋势线);

--  作者:st2199
--  发布时间:2012/3/1 10:38:05
--  

红线上方 开多单。下破平仓 反手做空 50%仓位

绿线下方 开空单。上破平仓 反手做多 50%仓位


--  作者:jinzhe
--  发布时间:2012/3/1 11:32:18
--  

if VAR1>REF(VAR1,1) and c>var1 then buy(holding=0,1,thisclose);

if cross(var1,c) then begin
 sell(holding>0,50%,thisclose);
 buyshort(holding=0,1,thisclose);
end
if VAR1<REF(VAR1,1) and c<var1 then buyshort(holding=0,1,thisclose);

if cross(c,var1) then begin
 sellshort(holding<0,50%,thisclose);
 buy(holding=0,1,thisclose);
end

在上面那些带面后面加上这些


--  作者:王锋
--  发布时间:2012/3/1 17:38:30
--  

next  是什么?

PEL的FOR循环是不需要NEXT的