Rss & SiteMap

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

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

标题:[求助]新手求助

1楼
sidadeapu 发表于:2016/7/30 21:57:01
     如果品种a和品种b具有相同的开仓条件和平仓条件,但是达到开仓条件的时间有先后,假如品种a先符合开多条件,品种b后符合开多条件,则只品种a开多;假如品种a先符合开多条件,品种b后符合开空条件,则品种a开多,品种b开空;假如品种b先符合开多条件,品种a后符合开多条件,则只品种b开多;假如品种b先符合开多条件,品种a后符合开空条件,则品种b开多,品种a开空;
请教编写思路。
2楼
jinzhe 发表于:2016/8/1 8:58:24

公式1:

nn1:=barslast(开多a);

nn2:=barslast(开空a);

 

mm1:=barslast(开多b);

mm2:=barslast(开空b);

 

公式2:

nn1:stkindi('','公式1.nn1',0,datatype);

nn2:stkindi('','公式1.nn2',0,datatype);

mm1:stkindi('','公式1.mm1',0,datatype);

mm2:stkindi('','公式1.mm2',0,datatype);

if nn1<nn2 and stricmp(stklabel,'品种a') then buy(holding=0,1,market);

if nn1>nn2 and stricmp(stklabel,'品种b') then buy(holding=0,1,market);

 

if mm1<mm2 and stricmp(stklabel,'品种a') then buyshort(holding=0,1,market);

if mm1>mm2 and stricmp(stklabel,'品种b') then buyshort(holding=0,1,market);

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


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