Rss & SiteMap

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

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

标题:程序编写问题

1楼
bravefist 发表于:2012/8/9 9:51:28
 

如果今天MA5>MA10,昨天MA5<MA10,那么今天算第一天,明天算第二天,在第6天的时候买入,以下编写为什么总是不对?

 

aa:=ma5>ma10 and ref(ma5,1)<ref(ma10,1);

if aa then begin

trend:=1;

daybars:=1;

end

if ref(trend,1)=1 then

daybars:=daybars+1;

if daybars=6 then

buy…

 

2楼
rushtaotao 发表于:2012/8/9 10:13:29
首先均线已经写的不对了ma5没有定义吧,ma(c,5)

如果是日线上,你可以用第6天作为今天来计算,然后前面都往前推

ma5:ma (c,5);
ma10:ma(c,10);
if ref(ma5,6)<ref(ma10,6) and ref(ma5,7)>ref(ma10,7) then buy(1,1,market);
共2 条记录, 每页显示 10 条, 页签: [1]


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