Rss & SiteMap

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

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

标题:请教:要在151338时才平仓,要怎么编写呢?

1楼
木鱼石传说 发表于:2013/5/15 15:44:33
本人在策略中编写了以下代码:

//收盘前自动平仓
if time > 151338 then begin
    sell(holding > 0, 0, thisclose);
    sellshort(holding < 0, 0, thisclose);
    end
请教:
    1,上述代码采用“固定时间间隔”轮询模式,时间间隔采用1秒钟,为什么执行的结果是15:13:00就下单平仓了,是什么原因?
    2,time取得的时间的本地计算机时间还是交易所行情时间?
    3,要完成15:13:38后才执行自动平仓,代码应该怎么写?
谢谢!
2楼
fly 发表于:2013/5/15 16:53:21
代码运行在几分钟周期?
3楼
木鱼石传说 发表于:2013/5/15 16:59:13
1分钟周期
4楼
木鱼石传说 发表于:2013/5/15 17:00:44
以下是引用fly在2013-5-15 16:53:21的发言:
代码运行在几分钟周期?应用在1分钟的K线周期上

5楼
fly 发表于:2013/5/15 17:08:01
//“固定时间间隔”轮询模式,1分钟周期
 
if DYNAINFO(207)>151338 and islastbar then begin
    sell(holding > 0, 0, thisclose);
    sellshort(holding < 0, 0, thisclose);
    end
 
if time > 151400 and not(islastbar) then begin
    sell(holding > 0, 0, thisclose);
    sellshort(holding < 0, 0, thisclose);
    end
6楼
木鱼石传说 发表于:2013/5/15 21:13:42
以下是引用fly在2013-5-15 17:08:01的发言:
//“固定时间间隔”轮询模式,1分钟周期
 
if DYNAINFO(207)>151338 and islastbar then begin
    sell(holding > 0, 0, thisclose);
    sellshort(holding < 0, 0, thisclose);
    end
 
if time > 151400 and not(islastbar) then begin
    sell(holding > 0, 0, thisclose);
    sellshort(holding < 0, 0, thisclose);
    end


请教:

这是两种不同的代码表达方式还是结合起来才能达到尾盘平仓的要求?

7楼
木鱼石传说 发表于:2013/5/15 21:14:28
另,能否进行策略评测?
8楼
木鱼石传说 发表于:2013/8/21 16:04:18
回顾一下
9楼
木鱼石传说 发表于:2013/8/21 16:08:42
请教老师:

您提供的这两种不同的代码表达方式还是结合起来才能达到尾盘平仓的要求?
共9 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.03418 s, 3 queries.