Rss & SiteMap

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

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

标题:[求证]goto的用法请高手指正,先谢谢了

1楼
wiffrey 发表于:2012/6/21 15:30:08

//4周转向
hh:=ref(hhv(h,20),1);
ll:=ref(llv(l,20),1);

entertime:=time<=143000;

if holding<0 and h>hh then begin

 sellshort(1,1,limitr,max(o,hh+0.2)+0.6);//先是平仓

 buy(1,1,limitr,max(o,hh+0.2)+0.6);

 goto skip@;

end

if holding>0 and l<ll then begin

 sell(1,1,limitr,min(o,ll-0.2)-0.6);//先是平仓

 buyshort(1,1,limitr,min(o,ll-0.2)-0.6);

end

skip@;

//注意做多条件和做空条件同时成立的处理方法,这里采用20周期均线向上才做多,向下才做空
if holding=0 and h>hh and ref(c,1)>ref(c,20) and entertime then buy(1,1,limitr,max(o,hh+0.2)+0.6);//后开仓
if holding=0 and l<ll  and ref(c,1)<ref(c,20) and entertime then buyshort(1,1,limitr,min(o,ll-0.2)-0.6);//后开仓
if time>=150000 then begin
 sell(1,1,limitr,o);
 sellshort(1,1,limitr,o);
end

 

以阿火的秘籍为例,红色字体是开多仓如果不加GOTO,当蓝色字体条件成立时就执行蓝色字体部分,如果加了GOTO是不是就不执行

蓝色字体部分,直接执行红色背景部分?还是红色或蓝色背景那个条件成立时就执行那个呢?如果是这样哪平仓指令是那个


红色字体是开多仓和跳转到红色背景,如果是这样哪先执行红色字体部分还是执行红色背景部分呢?哪蓝色字体那里要不要也加入goto skip@才能

执行蓝色背景的指令呢?

 

我能不能这样写,多头开仓后我直接跳转到多头离场的条件,而不是执行空头开仓的条件来平仓?

 

 

2楼
rushtaotao 发表于:2012/6/21 15:39:39

执行到了goto skip@无条件跳转到skip@

共2 条记录, 每页显示 10 条, 页签: [1]


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