請教:前根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