多单的利润从最高点回落20%后止盈,这个该怎么写啦?后台交易系统。
if (hhv(topenrpfit,tenterbars+1)-topenprofit)/hhv(topenprofit,tenterbars+1)>=0.2 and 持仓判断 then 平多语句;
到止盈全部平仓,这样写正确吗
if (hhv(topenprofit,tenterbars+1)-topenprofit)/hhv(topenprofit,tenterbars+1)>=0.2 and tbuyholdingex('',cu1,1)>1 then begin
tsell(1,tbuyholdingex('',cu1,1),mkt,0,0,'',cu1);
end
空单的止盈,是这样写吗
if (hhv(topenprofit,tenterbars+1)-topenprofit)/hhv(topenprofit,tenterbars+1)>=0.2 and tsellholdingex('',cu1,1)>0 then begin
tsellshort(1,tsellholdingex('',cu1,1),mkt,0,0,'',cu1);
end