以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  应该使用图表交易呢还是使用后台交易呢??  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=76490)

--  作者:pyd
--  发布时间:2015/3/16 10:30:26
--  应该使用图表交易呢还是使用后台交易呢??

请教:模型是使用图表交易模型获得交易信号,然后是一门后台交易函数下单,那么,这个时候我是应该使用图表交易呢还是使用后台交易呢??

这个模型是通过图表交易获得信号,后台下单,这个怎么办??

Globalvariable:hold=drawnull;
//蓝色部分改为你自己的模型
buycond:=h>ref(hhv(h,10),1);
sellcond:=l<ref(llv(l,10),1);
if holding>0 and sellcond then sell(1,1,market);
if holding<0 and buycond then sellshort(1,1,market);
if holding=0 and buycond then buy(1,1,market);
if holding=0 and sellcond then buyshort(1,1,market);
cc800988:=holding;//这句放在信号稳定的地方

drawtextex(1,1,800,0,\'虚拟持仓为:\'+numtostr(cc800988,0));//在图表上输入虚拟持仓以便监控
if not(islastbar) or workmode<>1 then exit;
xiadan800988:=cc800988-hold;
if xiadan800988>0.5 then begin
 cang:=min(xiadan800988,abs(hold));
 if hold<0 then begin
  tsellshort(1,cang,mkt,0,0,\'800988\'),allowrepeat;
  debugfile(\'D:\\800988.txt\',numtostr(hold,0)+\' \'+numtostr(cc800988,0)+\' 平空 %.0f\',cang);
 end
 cang:=xiadan800988+min(hold,0);
 if cang>0 then begin
  tbuy(1,cang,mkt,0,0,\'800988\'),allowrepeat;
  debugfile(\'D:\\800988.txt\',numtostr(hold,0)+\' \'+numtostr(cc800988,0)+\' 开多 %.0f\',cang);
 end
end
if xiadan800988<-0.5 then begin
 cang:=min(abs(xiadan800988),abs(hold));
 if hold>0 then begin
  tsell(1,cang,mkt,0,0,\'800988\'),allowrepeat;
  debugfile(\'D:\\800988.txt\',numtostr(hold,0)+\' \'+numtostr(cc800988,0)+\' 平多 %.0f\',cang);
 end
 cang:=abs(xiadan800988)-max(hold,0);
 if cang>0 then begin
  tbuyshort(1,cang,mkt,0,0,\'800988\'),allowrepeat;
  debugfile(\'D:\\800988.txt\',numtostr(hold,0)+\' \'+numtostr(cc800988,0)+\' 开空 %.0f\',cang);
 end
end
hold:=cc800988;


--  作者:jinzhe
--  发布时间:2015/3/16 10:31:22
--  
后台交易,图表交易是为了出虚拟的持仓数值,而实际下单是后台
--  作者:啊东西
--  发布时间:2015/3/16 10:42:17
--  
如果是使用后台交易的话,就没有使用图表交易了,这个时候,图表系统当中的虚拟持仓这些东西如何实现,是打开图表交易系统吗??还是加载后台交易系统的时候,图表交易系统就同时也通过后台加载上去了,只是图表上看不到?


--  作者:jinzhe
--  发布时间:2015/3/16 10:49:14
--  
不需要打开图表,仅仅使用后台交易就可以
--  作者:啊东西
--  发布时间:2015/3/16 11:07:47
--  
客服大哥,假如我现在在后台vba中通过全局变量取得了很多的值,如下
iffactor=Document.Getextdata("iffactor")
tffactor=Document.Getextdata("tffactor")
agfactor=Document.Getextdata("AGfactor")
alfactor=Document.Getextdata("ALfactor")
aufactor=Document.Getextdata("AUfactor")
buxfactor=Document.Getextdata("BUXfactor")
CUfactor=Document.Getextdata("CUfactor")
FUfactor=Document.Getextdata("FUfactor")
HCfactor=Document.Getextdata("HCfactor")
RBfactor=Document.Getextdata("RBfactor")
RUfactor=Document.Getextdata("RUfactor")
WRfactor=Document.Getextdata("WRfactor")
ZNfactor=Document.Getextdata("ZNfactor")
AXfactor=Document.Getextdata("AXfactor")
Bfactor=Document.Getextdata("Bfactor")
BBfactor=Document.Getextdata("BBfactor")
Cfactor=Document.Getextdata("Cfactor")               
CSfactor=Document.Getextdata("CSfactor")
FBfactor=Document.Getextdata("FBfactor")
Ifactor=Document.Getextdata("Ifactor")
Jfactor=Document.Getextdata("Jfactor")
JDfactor=Document.Getextdata("JDfactor")
JMfactor=Document.Getextdata("JMfactor")
Lfactor=Document.Getextdata("Lfactor")
Mfactor=Document.Getextdata("Mfactor")
Pfactor=Document.Getextdata("Pfactor")
PPfactor=Document.Getextdata("PPfactor")
Vfactor=Document.Getextdata("Vfactor")
Yfactor=Document.Getextdata("Yfactor")
CFfactor=Document.Getextdata("CFfactor")
FGfactor=Document.Getextdata("FGfactor")
GNfactor=Document.Getextdata("GNfactor")
LRfactor=Document.Getextdata("LRfactor")
NAfactor=Document.Getextdata("NAfactor")
MEfactor=Document.Getextdata("MEfactor")
OIfactor=Document.Getextdata("OIfactor")
PMfactor=Document.Getextdata("PMfactor")
RIfactor=Document.Getextdata("RIfactor")
RMfactor=Document.Getextdata("RMfactor")
ROfactor=Document.Getextdata("ROfactor")
RSfactor=Document.Getextdata("RSfactor")
SRXfactor=Document.Getextdata("SRXfactor")
TAfactor=Document.Getextdata("TAfactor")
就是这些,如果我现在想对这些数值进行排序排出大小,并且得到某一个值是排序。应该怎么写?

--  作者:jinzhe
--  发布时间:2015/3/16 11:12:20
--  
VBA排序请去高级研发区发帖咨询
--  作者:ymh8755
--  发布时间:2015/3/17 9:40:58
--  
我不是很懂,就听您的建议,使用后天交易看看。谢谢
以下是引用pyd在2015/3/16 10:30:26的发言:

请教:模型是使用图表交易模型获得交易信号,然后是一门后台交易函数下单,那么,这个时候我是应该使用图表交易呢还是使用后台交易呢??

这个模型是通过图表交易获得信号,后台下单,这个怎么办??

Globalvariable:hold=drawnull;
//蓝色部分改为你自己的模型
buycond:=h>ref(hhv(h,10),1);
sellcond:=l<ref(llv(l,10),1);
if holding>0 and sellcond then sell(1,1,market);
if holding<0 and buycond then sellshort(1,1,market);
if holding=0 and buycond then buy(1,1,market);
if holding=0 and sellcond then buyshort(1,1,market);
cc800988:=holding;//这句放在信号稳定的地方

drawtextex(1,1,800,0,\'虚拟持仓为:\'+numtostr(cc800988,0));//在图表上输入虚拟持仓以便监控
if not(islastbar) or workmode<>1 then exit;
xiadan800988:=cc800988-hold;
if xiadan800988>0.5 then begin
 cang:=min(xiadan800988,abs(hold));
 if hold<0 then begin
  tsellshort(1,cang,mkt,0,0,\'800988\'),allowrepeat;
  debugfile(\'D:\\800988.txt\',numtostr(hold,0)+\' \'+numtostr(cc800988,0)+\' 平空 %.0f\',cang);
 end
 cang:=xiadan800988+min(hold,0);
 if cang>0 then begin
  tbuy(1,cang,mkt,0,0,\'800988\'),allowrepeat;
  debugfile(\'D:\\800988.txt\',numtostr(hold,0)+\' \'+numtostr(cc800988,0)+\' 开多 %.0f\',cang);
 end
end
if xiadan800988<-0.5 then begin
 cang:=min(abs(xiadan800988),abs(hold));
 if hold>0 then begin
  tsell(1,cang,mkt,0,0,\'800988\'),allowrepeat;
  debugfile(\'D:\\800988.txt\',numtostr(hold,0)+\' \'+numtostr(cc800988,0)+\' 平多 %.0f\',cang);
 end
 cang:=abs(xiadan800988)-max(hold,0);
 if cang>0 then begin
  tbuyshort(1,cang,mkt,0,0,\'800988\'),allowrepeat;
  debugfile(\'D:\\800988.txt\',numtostr(hold,0)+\' \'+numtostr(cc800988,0)+\' 开空 %.0f\',cang);
 end
end
hold:=cc800988;


--  作者:jinzhe
--  发布时间:2015/3/17 9:47:43
--  
这个是后台下单的,不是图表下单的,不要用在图表上
--  作者:ymh8755
--  发布时间:2015/3/17 9:51:19
--  

我在复制公式的时候是在图表交易下面的“横盘突破”里面的公式,那我如何把这个公式和你给我的公式柔和到一起放在后天交易里面呢?

谢谢


--  作者:ymh8755
--  发布时间:2015/3/17 9:54:40
--  

版主,能否麻烦你帮我把横盘突破的公式和我想要的策略编辑在一起,然后给我发一个总的代码?我不太懂计算机,金字塔软件也是接触不久。所以,得麻烦版主啦。

辛苦了。

谢谢