公式网 股票指标公式源码分享 登录 注册
公式指标平网
未来函数检测
首页 金钻指标 通达信公式 大智慧公式 同花顺公式 文华财经公式 东财通公式 飞狐公式 操盘手公式 其他公式 公式解答 股票软件 股票池
当前位置:→ 公式网 > 通达信公式 > 正文 → 正文

通达信日内满仓反手的写法源码

发布时间:2016/2/19 7:29:37  浏览次数:

因为满仓的情况下,要等平仓单成交、保证金释放后,开仓下单才能成功。
 用系统自带的orderqueue在平仓单没有第一时间成交的情况下有一定的局限性,可用如下的方法:
runmode:0;
 input:cw(3,1,10,1);
 variable:cc=0;
 ma5:=ma(c,5);
 ma20:=ma(c,20);
 entertime:=time>100000 and time<144500;
 if holding>0 and cc<=0 then sell(1,cw,limitr,o);
 if holding<0 and cc>=0 then sellshort(1,cw,limitr,o);
 //此方法撤单和追单时间要控制在出信号的K线时间以内
if holding=0 and cc>0 and cw+tholding2>=cw then buy(1,cw,limitr,o);//平空成交后,"cw+tholding2>=cw "才会成立并开多
if holding=0 and cc<0 and cw-tholding2>=cw then buyshort(1,cw,limitr,o);//平多成交后,"cw-tholding2>=cw "才会成立并开空
if cc>0 and ma5<ma20 then cc:=0;
 if cc<0 and ma5>ma20 then cc:=0;
 if cc=0 and ma5>ma20 and entertime then cc:=1;
 if cc=0 and ma5<ma20 and entertime then cc:=-1;
 if time>=150000 then begin
 cc:=0;
 end
 

资源下载链接   资源大小:unknow

手机移动版 - 关于我们 - 联系我们 - 广告合作 - 下载声明 - 网站帮助 - 友情链接 - 网站地图 - TOP
湘ICP备09016573号-3 增值电信业务经营ICP许可证:湘B2-20210269 湘公网安备43108102000039号
Copyright © GSZX.COM.CN ,All Rights Reserved.
股票公式,股票指标,股票软件,股票知识