Board logo

标题: [金字塔源码] 区间专做多专做空策略源码 [打印本页]

作者: 龙听    时间: 2018-9-30 13:39     标题: 区间专做多专做空策略源码

源码如下:
  1. //区间多,专做多

  2. input:N(18,1,100,1);
  3. 开盘K线数:barslast(day<>ref(day,1))+1,linethick0;
  4. 开盘价:ref(c,开盘K线数-1),colorwhite;
  5. 上轨:开盘价+N,colorred;
  6. long:=cross(c,上轨);
  7. longend:=cross(开盘价,c);
  8. if holding=0 then buy(long,1,thisclose);
  9. if holding>0 then sell(longend,1,thisclose);
  10. if holding>0 and enterprice-c>=20 then sell(1,1,thisclose);
  11. if time>150500 and holding>0 then sell(1,1,thisclose);

  12. //区间空,专做空
  13. input:N(10,1,100,1);
  14. 开盘K线数:barslast(day<>ref(day,1))+1,linethick0;
  15. 开盘价:ref(c,开盘K线数-1),colorwhite;
  16. 下轨:开盘价-N,colorred;
  17. short:=cross(下轨,c);
  18. shortend:=cross(c,开盘价);
  19. if holding=0 then buyshort(short,1,thisclose);
  20. if holding<0 then sellshort(shortend,1,thisclose);
  21. if time>150500 and holding<0 then sellshort(1,1,thisclose);
复制代码





欢迎光临 龙听期货论坛 (http://www.qhlt.cn/) Powered by Discuz! 7.2