标题:
[金字塔源码]
区间专做多专做空策略源码
[打印本页]
作者:
龙听
时间:
2018-9-30 13:39
标题:
区间专做多专做空策略源码
源码如下:
//区间多,专做多
input:N(18,1,100,1);
开盘K线数:barslast(day<>ref(day,1))+1,linethick0;
开盘价:ref(c,开盘K线数-1),colorwhite;
上轨:开盘价+N,colorred;
long:=cross(c,上轨);
longend:=cross(开盘价,c);
if holding=0 then buy(long,1,thisclose);
if holding>0 then sell(longend,1,thisclose);
if holding>0 and enterprice-c>=20 then sell(1,1,thisclose);
if time>150500 and holding>0 then sell(1,1,thisclose);
//区间空,专做空
input:N(10,1,100,1);
开盘K线数:barslast(day<>ref(day,1))+1,linethick0;
开盘价:ref(c,开盘K线数-1),colorwhite;
下轨:开盘价-N,colorred;
short:=cross(下轨,c);
shortend:=cross(c,开盘价);
if holding=0 then buyshort(short,1,thisclose);
if holding<0 then sellshort(shortend,1,thisclose);
if time>150500 and holding<0 then sellshort(1,1,thisclose);
复制代码
欢迎光临 龙听期货论坛 (http://www.qhlt.cn/)
Powered by Discuz! 7.2