以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  初次写了个系统 看看有啥问题  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=97635)

--  作者:pyfans27
--  发布时间:2016/5/19 21:50:34
--  初次写了个系统 看看有啥问题
variable:positioncount=0;

atr:=ma(tr,20);

day20high:=ref(hhv(high,20),1);
day20low:=ref(llv(low,20),1);
day55high:=ref(hhv(high,55),1);
day55low:=ref(llv(low,55),1);

longcond1:=high>day20high;
shortcond1:low<day20low;

if longcond1 and positioncount=0 then 
begin
ss:=INTPART(asset*0.02/atr/MULTIPLIER);
buy(1,ss,market);
positioncount:=positioncount+1;
end

if high>enterprice+0.5*atr and positioncount<>0 and positioncount<4 then 
begin
ss:=INTPART(asset*0.02/atr/MULTIPLIER);
buy(1,ss,market);
positioncount:=positioncount+1;
end

if low<enterprice-2*atr then 
begin 
sell(1,100%,market);
positioncount:=0;
end

asset100:asset,noaxis;
持仓:holding,linethick0;

依照海龟规则 简单写了个
不知道有啥问题   为什么收益那么差  第一次写  有哪里写的不对呢?

--  作者:jinzhe
--  发布时间:2016/5/20 9:06:37
--  

再接再厉,多调试调试