Rss & SiteMap

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

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

标题:求一个多条件BUY函数的最佳实例

1楼
lzdanjian 发表于:2014/8/20 10:48:04
满足多个条件逻辑或,然后入场。还有一个要求就是只开仓1次对应平仓一次。随便什么条件都行,想求个最佳的实例
2楼
jinzhe 发表于:2014/8/20 11:01:51

以3个条件为例

variable:n1=0,n2=0,n3=0;

if 开仓条件1 and n1=0 and holding=0 then begin

     buy........;

     n1:=1;

end

 

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

     sell........;

     n1:=0;

end

 

if 开仓条件2 and n2=0 and holding=0 then begin

     buy........;

     n2:=1;

end

 

if 平仓条件2 and n2=1 and holding>0 then begin

     sell........;

     n2:=0;

end

 

if 开仓条件3 and n3=0 and holding=0 then begin

     buy........;

     n3:=1;

end

 

if 平仓条件3 and n3=1 and holding>0 then begin

     sell........;

     n3:=0;

end

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


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