请问:日内1分钟周期,我在开盘后m分钟、价格突破日内最高点的时候开多仓,然后我想这样设置止损位:(开仓时的日内最低点-abs(开仓时的日内最高点-开仓时的日内最低点)),请问应该如何编写?我的编写方式如下,但是这条代码应用于图表的时候没有运行:a6:=ref(hhv(high,todaybar),1);
a7:=ref(llv(low,todaybar),1);
a8:=a7-abs(enterprice-a7); //做多止损
//做多止损
if holding>0 and totaldaytrade<1 and low<=a8
then begin
sell(1,0,limitr,a8);
end
我想,之所以此条代码没有被运行,应该是因为a6和a7在不断地“更新”,无法“固定”。那应该如何编写呢?
a6:=ref(hhv(high,todaybar),enterbars); //开仓时的日内最高点
a7:=ref(llv(low,todaybar),enterbars); //开仓时的日内最低点
a8:=a7-abs(a6-a7); //按照您的止损位