首先建立一个指标,命名为YY,用来做引用,代码如下:
hh:ref(hhv(max(c,o),21),1);
然后再新建一个指标,这个指标是交易策略,命名按照用户自己的喜好来,代码如下:
hh:stkindi('','YY.hh',0,6);
if h>=hh*1.01 then buy(holding=0,100,thisclose);
if l<=enterprice*0.99 then sell(1,0,market);
if h>=enterprice*1.03 then sell(1,0,market);
注意使用时需要补充日线数据