请教:前根K阳线下根开多,前阴线下根开空。我就是想测试下发单。
if ref(c,1)>ref(o,1) then
begin
sellshort(1,1,thisclose);
buy(1,1,MARKET);
end
if ref(c,1)<ref(o,1) then
begin
sell(1,1,thisclose);
buyshort(1,1,market);
end
但实际执行时候,只能一直开多或一直开空,而不是根据前根阳或阴而变化,不明白是咋回事?
您好,开平仓条件加上holding的限制。
if ref(c,1)>ref(o,1) then
begin
sellshort(holding<0,1,thisclose);
buy(holding=0,1,MARKET);
end
if ref(c,1)<ref(o,1) then
begin
sell(holding>0,1,thisclose);
buyshort(holding=0,1,market);
end