以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  [求助]次交易日起卖出如何编写  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=47486)

--  作者:okmijn365
--  发布时间:2013/1/6 10:24:59
--  [求助]次交易日起卖出如何编写

请帮忙,谢谢!

 

N分钟周期下,买入后,要求从次一个交易日起开始卖出(不能从下一根K线起),这个“次交易日起”条件如何实现?

 

if 次一个交易日 and c>enterprice then sell(); 


--  作者:jinzhe
--  发布时间:2013/1/7 9:14:42
--  

date_1:=valuewhen(开仓条件,date);

if date>=date_1+1 and c>enterprice then sell;//注意,这个判断条件,正好月末的时候,不顶用


--  作者:fly
--  发布时间:2013/1/7 9:19:07
--  

用全局变量控制.以下为简单示例

 

variable:flag=0;// 全局变量,买开仓时赋值为1

 

if cond1 and holding=0 then

begin

 buy(1,1,market);

 flag:=1;

end

 

if cond2 and holding>0 and flag=0 then  sell(1,1,thisclose);

 

if time=150000 then flag:=0;// 商品期货,收盘的同时,flag赋值为0


--  作者:okmijn365
--  发布时间:2013/1/7 15:44:13
--  
多谢2位