variable:c1:=1;
r1:=barslast(date<>ref(date,1));
if r1=0 then c1:=1;
r2:=asset-ref(asset,r1+1);
r3:=ref(asset,r1+1)-asset;
if r2>n1 then c1:=-1;
if r3>n2 then c1:=-1;
.............
.............
if cond1 and c1>0 then
begin
sellshort.......
buy..............
end
if cond2 and c1>0 then
begin
sell.......
buyshort......
end
if c1<0 then
begin
sell.........
sellshort......
end
[此贴子已经被作者于2013-3-3 9:51:59编辑过]
VARIABLE: YTDASSET=0;
IF DATE<>REF(DATE,1) THEN BEGIN
YTDASSET:=ASSET;END
MAXRKKC:=REF(ASSET-YTDASSET,1)>-KS;
MAXRKPC:=REF(ASSET-YTDASSET,1)<-KS;
多谢!请问这种写法是正确的吗