以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  金字塔DLL 连接QQ群怎么显示变量未定义 ?  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=94834)

--  作者:cc315416174
--  发布时间:2016/3/16 21:49:57
--  金字塔DLL 连接QQ群怎么显示变量未定义 ?

 
按此方法设置了http://www.weistock.com/bbs/dispbbs.asp?boardid=5&ID=11344

 VBA中:

Function QQMSGX (Formula,QQNum,QQMSG)
   QQMSG=document.GetExtString("QQSTR")
  
   Set obj = CreateObject("WWSCommon.TCGroup")
   bq = " 交易系统信号发布 "
   mxmsg = bq &"  " & Date &" " & Time & vbCrLf & " 信号" & " " & QQMSG
   call obj.TransMessage("金字塔程序化交易群S", mxmsg)
   Set obj = Nothing 
  
   Set obj = CreateObject("WWSCommon.TCGroup")  
   call obj.TransMessage("Miss", mxmsg)
   Set obj = Nothing 
  
End Function


Function QQMSSG(Formula,QQNum,QQMSG)
    \'系统会在逐K线模式解释公式时的每个周期都会调用此函数一遍,因此设计时应该注重程序的执行效率,不要重复的执行一些没必要的代码
 
 QQMSG=document.getextData("字符串")              \'获取公式中设置的变量值

   Set obj = CreateObject("WWSCommon.TCGroup")
   call obj.TransMessage(315416174, QQMSG)
   Set obj = Nothing

End Function

 

 

金字塔公式中:

GLOBALVARIABLE: bb=0;

 

VBuy:l<=o;
VSell:h>=o;
   
if islastbar and bb<>barpos and not(VBuy) and not(VSell) then
  begin
     bb:= barpos;
     extgbstringSet(\'QQSTR\',\'PR \'+numtostr(close,5) + \' OB \'+numtostr(h,5)+\' OS \'+numtostr(l,5) );
     VQQM:=QQMSGX(1,close);
   end
      
if VBuy then
begin
  buy(1,1,limitr,c);       {开多}
  if islastbar and bb<>barpos then
   begin
      bb:= barpos;
      extgbstringSet(\'QQSTR\',\'1分钟超卖,尝试开多:\'+numtostr(close,5));
      VQQM:=QQMSGX(1,close);
   end
end;
     
if VSell then
begin
  sell(1,1,limitr,c);       {开多}
  if islastbar and bb<>barpos then
   begin
      bb:= barpos;
      extgbstringSet(\'QQSTR\',\'1分钟超买,尝试开空:\'+numtostr(close,5));
      VQQM:=QQMSGX(1,close);
   end
end;

 

 

但是 显示

 

 

求版主看看 如何 解决~~谢谢啦


--  作者:cc315416174
--  发布时间:2016/3/16 21:53:43
--  
图片点击可在新窗口打开查看
--  作者:yukizzc
--  发布时间:2016/3/16 23:09:45
--  

1、在公式编辑器界面中,鼠标在“函数”解释定义区单击右键,然后选择“添加自定义函数”。

是通过这种方式添加了qqmsgx自定义的函数吗??


--  作者:cc315416174
--  发布时间:2016/3/18 21:40:14
--  
恩~谢谢版主~金字塔 很好很强大~