以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  日内交易当天连亏3次停止交易,隔天继续怎么写?  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=10350)

--  作者:小布丁
--  发布时间:2012/2/29 16:32:40
--  日内交易当天连亏3次停止交易,隔天继续怎么写?

buycond:=ref(c>ma(c,10),1)  and time<144000;

sellcond:=ref(c<ma(c,10),1) and time<144000;

if holding>0 and sellcond then sell(1,1,market);

if holding<0 and buycond then sellshort(1,1,market);

if holding=0 and buycond then buy(1,1,market);

if holding=0 and sellcond then buyshort(1,1,market);

if time>=145000 then begin

    sell(holding>0,1,market);

    sellshort(holding<0,1,market);

end

 

请问日内交易模型,如果当天信号连亏3次的时候,停止交易等到第二天再继续,应该怎么写?


--  作者:just
--  发布时间:2012/2/29 17:20:49
--  
参考函数NUMLOSSTRADE