以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  请教关于开仓的问题  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=59165)

--  作者:punkcat401
--  发布时间:2013/11/25 10:08:30
--  请教关于开仓的问题

IF 条件A THEN BUY 之后


1、针对条件A的多头开仓,如果平仓,日内不再做多。

 

2、针对条件A的多头开仓,如果平仓,30根K线内不做多。


--  作者:jinzhe
--  发布时间:2013/11/25 10:16:29
--  

什么是针对A的平仓?有很多个开仓条件? 

 


--  作者:punkcat401
--  发布时间:2013/11/25 10:23:30
--  
以下是引用jinzhe在2013/11/25 10:16:29的发言:

什么是针对A的平仓?有很多个开仓条件? 

 

是的,同时有条件A时做多,条件B时做多,条件C时做多

只针对条件A的多单,平仓后不再做多


--  作者:jinzhe
--  发布时间:2013/11/25 10:28:47
--  

variable:n=0;

variable:m=0;

if 开仓条件A and holding=0 and m<>1 then begin

   buy;

   n:=1;

end

 

if 开仓条件b and holding=0 and m<>1  then begin

   buy;

   n:=2;

end

 

if 开仓条件c and holding=0 and m<>1 then begin

   buy;

   n:=3;

end

 

if 平仓条件a and holding>0 and n=1 then begin

   sell;

   m:=1;

end

 

 


--  作者:punkcat401
--  发布时间:2013/11/25 10:34:03
--  
以下是引用jinzhe在2013/11/25 10:28:47的发言:

 

不是条件A平仓后一直不做多,是在两种时间限制的情况下

1、日内不再做多

2、30根K线内不做多

[此贴子已经被作者于2013/11/25 10:34:22编辑过]

--  作者:jinzhe
--  发布时间:2013/11/25 10:39:42
--  

variable:n=0;

variable:m=0;

if 开仓条件A and holding=0 and m<>1 then begin

   buy;

   n:=1;

end

 

if 开仓条件b and holding=0 and m<>1  then begin

   buy;

   n:=2;

end

 

if 开仓条件c and holding=0 and m<>1 then begin

   buy;

   n:=3;

end

 

if 平仓条件a and holding>0 and n=1 then begin

   sell;

   m:=1;

end

 

if time=closetime(0) then m:=0;

if m=1 and ref(m,30)=1 then m:=0;

[此贴子已经被作者于2013/11/25 10:40:06编辑过]