以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  求助金字塔的交易数据记忆的编写方法  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=85475)

--  作者:双飞燕
--  发布时间:2015/9/22 8:40:17
--  求助金字塔的交易数据记忆的编写方法
 开仓手数:5;
买开仓条件:C>OPEN+20,使用挂单委托,委托价为:市场价-5;
追单条件: C>委托价+15
                撤单并追单,追单价为涨停价;

平多单条件:C<OPEN-20,使用挂单委托,委托价为:市场价+5;
追单条件:C<委托价-15
               撤单并追单,追单价为跌停价;

--  作者:jinzhe
--  发布时间:2015/9/22 8:48:24
--  

成交了怎么办?

追单撤单系统自带的就有,在下单设置---程式化交易--追单撤单设置里面


--  作者:双飞燕
--  发布时间:2015/9/22 12:07:20
--  
 1,如果成交了3手,那么追单的时候只需要追2手,如果全部成交,就不需要追单;
2,我知道系统有自带的追单系统,但我真正需要的是成交后某些参数的记忆,比如,委托价,委托手数,委托时间,当时的kdj,macd。。。等我需要的参数。
所以我的标题是记忆交易数据,我想通过上面委托价的例子,深刻的去理解金字塔的奥秘。
[此贴子已经被作者于2015/9/22 12:08:27编辑过]

--  作者:jinzhe
--  发布时间:2015/9/22 13:30:51
--  


if c>o+20 and extgbdata(\'time\')<>time then begin
 tbuy(1,5,lmt,dynainfo(7)-5);
 extgbdataset(\'jiage\',dynainfo(7)-5);
 extgbdataset(\'time\',time);
end

if c>extgbdata(\'jiage\')+15 and extgbdata(\'tt\')<>time then begin
 ss:=TREMAINQTY( 1, \'\',\'\' );
 tcancel(1,1);
 extgbdataset(\'tt\',time);
 tbuy(1,ss,lmt,DYNAINFO( 54));
end

 

if c<o-20 and extgbdata(\'time2\')<>time then begin
 tbuy(1,5,lmt,dynainfo(7)+5);
 extgbdataset(\'jiage2\',dynainfo(7)+5);
 extgbdataset(\'time2\',time);
end

if c>extgbdata(\'jiage2\')+15 and extgbdata(\'tt2\')<>time then begin
 ss2:=TREMAINQTY( 3, \'\',\'\' );
 tcancel(1,3);
 extgbdataset(\'tt2\',time);
 tbuy(1,ss2,lmt,DYNAINFO( 54));
end


--  作者:双飞燕
--  发布时间:2015/9/23 5:43:45
--  
 jinzhe,您好。非常感谢您的解答。唯一的缺陷是没有写到平多单的挂单和追单部分。我想,开单的追单和平单的追单写法应该不一样的,开单可以直接追,不必等撤单是否完成。而平单必须等撤单完成并返回可以持仓后才能追单。而这正是我不会的部分,烦请你再辛苦一下,谢谢您了。
--  作者:jinzhe
--  发布时间:2015/9/23 9:05:38
--  

if c<o-20 and extgbdata(\'time2\')<>time then begin
 tbuy(1,5,lmt,dynainfo(7)+5);
 extgbdataset(\'jiage2\',dynainfo(7)+5);
 extgbdataset(\'time2\',time);
end

if c>extgbdata(\'jiage2\')+15 and extgbdata(\'tt2\')<>time then begin
 ss2:=TREMAINQTY( 3, \'\',\'\' );
 tcancel(1,3);
 extgbdataset(\'tt2\',time);
 tbuy(1,ss2,lmt,DYNAINFO( 54));
end

 

 

这段要这样改

 

if c<o-20 and extgbdata(\'time2\')<>time then begin
 tsell(1,5,lmt,dynainfo(7)+5);
 extgbdataset(\'jiage2\',dynainfo(7)+5);
 extgbdataset(\'time2\',time);
end

if c>extgbdata(\'jiage2\')+15 and extgbdata(\'tt2\')<>time then begin
 ss2:=TREMAINQTY( 3, \'\',\'\' );
 tcancel(1,2);
 extgbdataset(\'tt2\',time);
 tsell(tisremain(2)=0,ss2,lmt,DYNAINFO( 54));
end

 

[此贴子已经被作者于2015/9/23 9:10:15编辑过]