Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共3 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:老师,如何控制一个小时内只第一次上穿指标线买人。

1楼
zyglys 发表于:2014/4/13 0:24:27
老师,如何控制一个小时内只第一次上穿指标线时买人
2楼
netfox 发表于:2014/4/13 14:29:51
time<100000  这样吗?
3楼
qwer123 发表于:2014/4/13 16:47:04
比如1分钟k线
r1:=ma(c,5);
r2:=ma(c,10);

if barpos=1 then buyshort(holding=0,1,thisclose);
if holding=0 and enterbars>=60 and cross(r1,r2) then buy(holding=0,1,thisclose);
if holding=0 and enterbars>=60 and cross(r2,r1) then buyshort(holding=0,1,thisclose);

if holding>0 and cross(r2,r1) then sell(holding>0,0,thisclose);
if holding<0 and cross(r1,r2) then sellshort(holding<0,0, thisclose);


注意:1.这个程序只能做测试用,如果实盘交易限制k线数量,会引起信号变化;
        2.对于日内交易要考虑第一次开仓的问题;

共3 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.01563 s, 2 queries.