Rss & SiteMap

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

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

标题:[求助]

1楼
冷锋566 发表于:2015/7/3 20:22:06
当一个条件成立后开仓,后面的条件再成立则不再开仓???谢谢!
比如下面的如何修改
/引用kdj的数值;
k:"kdj.k";
d:"kdj.d";
//建立多头条件
long:k>65;
if long then
   begin
   sellshort(holding<0,0,thisclose);
   buy(long,1,thisclose);
   end
  
//建立空头条件
short:k<50;
   if short then
   begin
   sell(holding>0,0,thisclose);
   buyshort(short,1,thisclose);
   end
   

2楼
jinzhe 发表于:2015/7/6 8:47:51
k:"kdj.k";
d:"kdj.d";
//建立多头条件
long:k>65;
variable:duo=0,kong=0;
if long then
   begin
   sellshort(holding<0,0,thisclose);
   if holding=0 and long and duo=0 then begin
       buy(long,1,thisclose);
       duo:=1;
       kong:=0;
   end
end
  
//建立空头条件
short:k<50;
if short then
begin
   sell(holding>0,0,thisclose);
   if holding=0 and short and kong=0 then begin
       buyshort(short,1,thisclose);
       kong:=1;
       duo:=0;
   end
end
共2 条记录, 每页显示 10 条, 页签: [1]


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