投资者咨询:请老师帮忙编一下文华的代码 (文华财经WH8赢智V8.2)
来源:文华财经 日期:2018-7-12 9:27
inputs:
n1(2),
n2(2),
Count(30),
lots(1);
variables:
a1(0),
a2(0),
g1(0),
g2(0),
i_count(0);
a1=Highest(h,n2);
a2=Lowest(l,n2);
if(currentbar=1) then begin
g1=0;
g2=0;
i_count=0;
end;
print(text(date),text(Time) ,text(g1),text(g2),text(currentbar));
if(i_count=Count) then begin
g1=0;
g2=0;
i_count=0;
end;
if(c>a1[1] ) then begin
g1=g1-1;
g2=g2+1;
end;
if(c<a2[1]) then begin
g1=g1+1;
g2=g2-1;
end;
if(g2>n1 and MarketPosition<>1 )then
buy lots shares next bar at market;
if(g1>n1 and MarketPosition<>-1)then
sellshort lots shares next bar at market;
i_count=i_count+1;
技术人员回复
日期:2018-7-12 9:51