以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  [求助]帮改为金字塔的  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=47737)

--  作者:系统使用者
--  发布时间:2013/1/15 12:14:07
--  [求助]帮改为金字塔的
if aa+bb+cc+dd+ee+ff+gg+hh>0 then Buy(\'\',DEFAULT,0,0,OT_Market,OB_NextBar,\'\');
if aa+bb+cc+dd+ee+ff+gg+hh<0 then SellShort(\'\',DEFAULT,0,0,OT_Market,OB_NextBar,\'\');
SetExitOnClose;

这是金魔方的语句:要求以次周期开盘价限价开仓,收盘平仓。

该为金字塔的就出现错误信号。
如何搞?

--  作者:系统使用者
--  发布时间:2013/1/15 12:16:38
--  

tmp:=aa+bb+cc+dd+ee+ff+gg+hh;

if holding=0 then begin
 if tmp>0 then
  buy(1,2,LIMIT,OPEN);
end
if holding=0 then begin
 if tmp<0 then
  buyshort(1,2,LIMIT,OPEN); 
end
if holding>0 then begin
 if tmp<0 then begin
  sell(1,holding,LIMIT,OPEN);
  buyshort(1,2,LIMIT,OPEN);
 end
end
if holding<0 then begin
 if tmp>0 then begin
  sellshort(1,holding,LIMIT,OPEN);
  buy(1,2,LIMIT,OPEN);
 end
end

if time>145800 and time<=150000 then begin
sell(1,0,marketr);
sellshort(1,0,marketr);
end

 

完全与金魔方里面的信号不一致


--  作者:系统使用者
--  发布时间:2013/1/15 12:18:45
--  
Buy(\'Symbol\'=\'\', Lots=DEFAULT, Price=0, Slippage=0,OT=OT_Market, OB=OB_NextBar, EntryName=\'\')

参数: Symbol:品种代码,指定委托的品种,空串表示当前品种
Lots:委托量,取值DEFAULT时,对于开仓指令,实际委托量在[策略设置]中设置;对于平仓指令,表示全部平仓
Price:委托价,对于限价单、停损单需要指定的委托价格
Slippage:允许滑价,几跳报价最小变动单位,取值-1表示不限滑价,取值0时,实际允许滑价可在[策略设置]中设置。
实际发送委托价为Price+Slippage*MinDiff.对于OT_Stop单,可用该参数进行限价。
OT:委托类型,取值可为以下枚举类型
OT_Market: 市价单
OT_Limit: 限价单
OT_Stop : STOP单、停损单
OT_Open : 开盘单
OT_Close: 收盘单
OB:委托时机及有效时期,取值可为以下枚举类型
OB_NextBar: 次周期
OB_ThisBar: 本周期
EntryName:开仓命名,可用于区分开仓信号,分批开仓取用不同名后,平仓可指定EntryName只平该笔持仓

多头开仓的OT+OB组合:
OT_Market,OB_NextBar:次周期一开盘即发市价单
OT_Limit,OB_NextBar:市场价下跌达到或低于Price时开仓,次周期内有效
OT_Stop,OB_NextBar:市场价上涨达到或超过Price时开仓,次周期内有效
OT_Open,OB_NextBar:对于日线,表示集合竞价开盘单。日线以下周期,次周期开盘时下市价单。
OT_Close,OB_ThisBar:对于日线或日线以下收市前最后1个周期,[策略设置]中设置收市前若干秒下单,或进行收盘集合竞价。
日线以下周期日内,次周期开始时下市价单。


--  作者:系统使用者
--  发布时间:2013/1/15 12:19:39
--  

收市时平仓

用法:

SetExitOnClose
日内交易在收市前全部平仓,平仓时机在【策略设置】中设置“日收盘交易在(n)秒前下单”
测评时以收市价作为交易价格
一旦到达设定时间,自动平仓之后,策略所发出的开仓信号将全部截留,
当天不再执行,等到第二天的开盘第一根执行


--  作者:系统使用者
--  发布时间:2013/1/15 12:20:18
--  

这是他的函数。

用我们金字塔该如何搞???


--  作者:jinzhe
--  发布时间:2013/1/15 13:09:51
--  
开仓条件里面加上时间条件time<145800
--  作者:系统使用者
--  发布时间:2013/1/16 0:03:33
--  
具体帮改改啊
--  作者:jinzhe
--  发布时间:2013/1/16 9:10:28
--  
上述语句基本没有问题,只能从这个细节入手了
--  作者:系统使用者
--  发布时间:2013/1/16 12:09:11
--  

if holding=0 then begin
 if tmp>0 and time<145000 then
  buy(1,2,LIMIT,OPEN);
end
if holding=0 then begin
 if tmp<0 and time<145000 then
  buyshort(1,2,LIMIT,OPEN); 
end
if holding>0 then begin
 if tmp<0 and time<145000 then begin
  sell(1,holding,LIMIT,OPEN);
  buyshort(1,2,LIMIT,OPEN);
 end
end
if holding<0 then begin
 if tmp>0 and time<145000 then begin
  sellshort(1,holding,LIMIT,OPEN);
  buy(1,2,LIMIT,OPEN);
 end
end

if time>145800 and time<=150000 then begin
sell(1,2,market);
sellshort(1,2,market);
end


--  作者:系统使用者
--  发布时间:2013/1/16 12:09:29
--  

还是有问题