此保本策略写的是否正确,但是在策略测试和K线图中未起到作用,求解。
exlong:=(hhv(h,enterbars)-enterprice)>n and cross(enterprice,c);
//多单保本止损策略:当最大浮动盈利达到N个点,当最新价向下穿越开仓价。
把条件变量 显示出来
看到底是哪个变量没符合条件。
tiaoshi1:hhv(h,enterbars);
tiaoshi2:tiaoshi1-enterprice>n;
tiaoshi3:cross(enterprice,c);
exlong:=(hhv(h,enterbars)-enterprice)>n and cross(enterprice,c);
1:这个必须是在盘中才能发现是哪个条件不成立,还是通过策略测试就能发现的?
2:
tiaoshi1:hhv(h,enterbars);
tiaoshi2:tiaoshi1-enterprice>n;
tiaoshi3:cross(enterprice,c);
这三个返回值都是1或者0,我要再哪里看返回值的记录呢?
按照leevolvo的方法,在主图中K线和条件语句所返回的值 0 和 1 ,不能很好的显示在一起,如何改进一下,让K线图正常显示呢。
从纵坐标可以看出,最小值是从0开始的,这样K线图必然不能正常显示。
加",linethick0;"或NOAXIS
(1)tiaoshi1:hhv(h,enterbars),linethick0;
(2)tiaoshi1:hhv(h,enterbars),noaxis;