ref(hhv(h,30),1);//前30周期最高价
都可以用VARIABLE定义的全局变量获得.
variable:bpos=0,bprice=0,bhigh=0;// 全局变量
if cond1 and holding>0 then
begin
sell(1,1,market);
end
if cond2 and holding=0 and lossnum<3 then
begin
buy(1,1,market);
bpos:=barpos;//买开位置
bprice:=c; //买开价格
bhigh:=h;//买开以来的最高价
end
if h>bhigh and holding>0 then bhigh:=h;
您好,
1,取之前N周期的最高价REF(HHV(H,N),1).
2,去卖开位置用barslast函数,用您卖开的条件为判断.
3,enterprice可取到开仓价
4,同问题2,AA:BARSLAST(买开条件);
买开以来最高价:HHV(H,AA)