  
- UID
- 2
- 积分
- 2914403
- 威望
- 1407234 布
- 龙e币
- 1507169 刀
- 在线时间
- 13521 小时
- 注册时间
- 2009-12-3
- 最后登录
- 2025-3-3

|
源码如下:
- //超简单海龟代码,供入门者学习,
- h10:ref(hhv(h,10),1),colorgreen;//前10根K线高点
- l10:ref(llv(l,10),1),colorgreen;//前10根K线低点
- h20:ref(hhv(h,20),1),colorred;//前20根K线高点
- l20:ref(llv(l,20),1),colorred;//前20根K线低点。
- long:=cross(c,h20);//价格上穿前20根线高点,做多条件
- longend:=cross(l10,c);//价格跌破前10根K线低点,做多终止条件
- short:=cross(l20,c);//价格跌破前20根K线低点,做空条件
- shortend:=cross(c,h10);//价格上穿前10根K线高点,做空终止条件
- if holding=0 then begin//建仓代码 来源 www.cxh99.com
- buy(long,1,thisclose);
- buyshort(short,1,thisclose);
- end
- if holding<>0 then begin//平仓代码
- sell(longend,1,thisclose);
- sellshort(shortend,1,thisclose);
- end
复制代码 |
论坛官方微信、群(期货热点、量化探讨、开户与绑定实盘)
|