Rss & SiteMap

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

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

标题:设置时间强行平仓

1楼
kuge 发表于:2014/11/13 10:57:47
请教老师,以下面设置时间形式进行强制平仓,但是最后却没有平掉,holding最后是变为0,但是没进行图表交易,
应该怎样去设置?谢谢


if currenttime >= 151450 then                //强制收盘平仓
begin
sell(1,holding,market);  
sellshort(1,holding,market);
end
2楼
qq代人发帖 发表于:2014/11/13 11:22:21

1,用time,不用用currenttime,

2,开平仓条件最好加上holding的限制,

sell(holding>0,holding,market);

sellshort(holding<0,holding,market);

 

3楼
kuge 发表于:2014/11/13 11:27:02
就没有触发价格   日志上面没有记录    这个holding应该没有影响

4楼
yukizzc 发表于:2014/11/13 11:33:28

1.你图表运行模式是什么?你看下日志1450到1500这段时间内有程序化运行完毕的字样没

2.currenttime这个只有最新值,这么用会导致你历史上平仓信号消失的。可以这么处理下,if (time=151500 and not(islastbar))or currenttime >= 151450 and islastbar then sell();

5楼
netfox 发表于:2014/11/13 11:36:45
time>=151450 这么写才对吧。
6楼
pyd 发表于:2014/11/13 13:07:19

是用time,你是多少周期k线?双击鼠标看下k线时间。

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


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