--  作者:xunzhe 
        --  发布时间:2017/3/14 17:24:43 
        
        --   
          
runmode:0; 
	variable:zs=0,cc=0,hl=0; 
	ma5:=ma(c,5); 
	ma20:=ma(c,20); 
	entertime:=time>100000 and time<144500; 
	if holding>0 and cc<=0 then sell(1,1,limitr,o); 
	if holding<0 and cc>=0 then sellshort(1,1,limitr,o); 
	if holding=0 and cc>0 then buy(1,1,limitr,o); 
	if holding=0 and cc<0 then buyshort(1,1,limitr,o); 
	if cc>0 and l<zs then begin 
	 sell(1,1,limitr,min(o,zs-0.6)); 
	 cc:=0; 
	end 
	if cc<0 and h>zs then begin 
	 sellshort(1,1,limitr,max(o,zs+0.6)); 
	 cc:=0; 
	end 
	if cc>0 and ma5<ma20 then cc:=0; 
	if cc<0 and ma5>ma20 then cc:=0; 
	if cc=0 and ma5>ma20 and entertime then begin 
	 cc:=1; 
	 zs:=c-10; 
	 hl:=h; 
	end 
	if cc=0 and ma5<ma20 and entertime then begin 
	 cc:=-1; 
	 zs:=c+10; 
	 hl:=l; 
	end 
	if cc>0 and h>hl then begin//创新高后,上移hl 
	 hl:=h; 
	 zs:=hl-10; 
	end 
	if cc<0 and l<hl then begin//创新低后,下移hl 
	 hl:=l; 
	 zs:=hl+10; 
	end 
	if time>=150000 then begin 
	 cc:=0; 
	end 
	  
	如何更简单的理解全局变量的用法?
  
         
       |