Rss & SiteMap

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

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

标题:[求助]

1楼
wzywzy292 发表于:2012/7/19 22:23:36
 有二个模型,都是图表交易,逐K线,现在要把他们组合成一个图表逐K线交易的模型,应该怎么做?

模型1:开仓条件AA,平仓条件BB。
模型2:开仓条件CC,平仓条件DD。

模型1 先触发 就执行模型1,其间即使 模型2的开仓条件成立,也不执行模型2。

模型2 先触发 就执行模型2,其间即使 模型1的开仓条件成立,也不执行模型1。


谢谢!!!





2楼
jinzhe 发表于:2012/7/20 8:43:00

if aa and holding=0 then buy(holding=0,1,market);

if cc  and  holding=0 then buy(holding=0,1,market);

两个开仓条件都限定没有持仓时才能下单,这样就能避免条件满足就下单。

3楼
wzywzy292 发表于:2012/7/20 10:12:05
IF AA=1 THEN GOTO 模型1@;
IF CC=1 THEN GOTO 模型2@;

模型1@;
if aa and holding=0 then BEGIN
buy(holding=0,1,market);
SELL(BB,1,market);
END;
goto end@;
模型2@;
if CC and holding=0 then BEGIN
buy(holding=0,1,market);
SELL(DD,1,market);
END;
goto end@;
end@;

这样写只执行模型1 不执行模型2,请教是什么地方的问题,谢谢!!!
[此贴子已经被作者于2012-7-20 10:14:52编辑过]
4楼
wzywzy292 发表于:2012/7/20 15:56:03
 高手帮我
5楼
just 发表于:2012/7/20 16:43:41


if aa=1 and holding=0 then BEGIN
buy(holding=0,1,market);
SELL(BB,1,market);
END
if CC=1 and holding=0 then BEGIN
buy(holding=0,1,market);
SELL(DD,1,market);
END;


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


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