老师,我的意思是,close 上穿 均线就开多单,下穿 就开空,200点作为止损点,只有碰到止损点就反手。
运行的时候,说第五行,错误:解释错误
input:N(20,1,1000,5),STOPLOSS(200,100,1000,20);
ma1:=ma(close,n);
if cross(close,ma1) and then
begin
sellshort(holding<0,1,thisclose);
buy(holding<=0 ,1,thisclose);
end
if cross(ma1,close) and then
begin
sell(holding>0,1,thisclose);
buyshort(holding>=0,1,thisclose);
end
if holding>0 and Low<=enterprice-Stoploss then
begin
sell(1,Low);
buyshort(1,Low);
end
if holding<0 and High>=enterprice-Stoploss then
begin
sellshort(1,High);
buy(1,High);
end
if cross(close,ma1)以及if cross(ma1,close)后面多了and