Rss & SiteMap

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

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

标题:[求助] 后台交易 为何 不能使用 自定义函数?

1楼
chenwc 发表于:2012/12/29 1:47:52
在后台交易中, 调用自定义函数, 但没有任何的反应, 是不是在后台交易中,无法使用自定义函数呢?
2楼
guotx2010 发表于:2012/12/29 8:17:34
可以使用过的,估计是你的函数写的有问题。
3楼
chenwc 发表于:2012/12/29 16:32:23
可是我同样的自定义函数,在图表程序化交易中,是正常的。  切换到后台交易,那段自定义函数就没有执行。 
4楼
admin 发表于:2012/12/29 16:46:41

http://www.weistock.com/bbs/dispbbs.asp?boardid=4&Id=332

问题4,使用后台的调试方法调试一下

5楼
chenwc 发表于:2012/12/29 19:13:08
debugfile  我调试过,加在自定义函数后面,可以正常输出, 但自定义函数输出没有反应。
6楼
王锋 发表于:2012/12/29 19:42:11

在VBA中,使用APPLICATION.MSGOUT,看看有没有输出,在VBA中做一下调试

7楼
chenwc 发表于:2012/12/31 11:14:58
测试了,  自定义函数没有执行哦。
8楼
chenwc 发表于:2012/12/31 14:24:01
自己顶起来一下。
9楼
王锋 发表于:2012/12/31 14:55:31

同样的公式在图表上是可以工作的吗?

是否方便将公式范例放论坛,我们客服测试一下问题

10楼
chenwc 发表于:2012/12/31 20:01:48
阿火后台模板-K线走完模式
Globalvariable:hold=drawnull;
cc800988:=holding;//这句放在信号稳定的地方

//////以下部分改为你自己的模型(K线走完模型)////////////
/////////////////////////////////////////////////////////
buycond:=ref(count(c>o,2)=2,1);
sellcond:=ref(count(c<o,2)=2,1);
if holding>0 and sellcond then begin 
sell(1,1,thisclose);
TestSelfFunc(date);
debugfile('D:\2222.txt', numtostr(date,2) + ',sell,' + '%.2f', thisclose);
end
if holding<0 and buycond then begin
sellshort(1,1,thisclose);
TestSelfFunc(date);
debugfile('D:\2222.txt', numtostr(date,2) + ',sellshort' + '%.2f', thisclose);
end
if holding=0 and buycond then begin
buy(1,1,thisclose);
TestSelfFunc(date);
debugfile('D:\2222.txt', numtostr(date,2) + ',buy' + '%.2f', thisclose); 
end
if holding=0 and sellcond then begin
buyshort(1,1,thisclose);
TestSelfFunc(date);
debugfile('D:\2222.txt', numtostr(date,2) + ',buyshort' + '%.2f', thisclose);
end
==============================================================
自定义函数TestSelfFunc:

Function TestSelfFunc(Formula,date)
    '系统会在逐K线模式解释公式时的每个周期都会调用此函数一遍,因此设计时应该注重程序的执行效率,不要重复的执行一些没必要的代码
    TestSelfFunc=0
APPLICATION.MSGOUT("test")
TestSelfFunc=1
End Function

======================================================
还请客服测试一下,望回复!
共18 条记录, 每页显示 10 条, 页签: [1] [2]


Powered By Dvbbs Version 8.3.0
Processed in 0.03516 s, 2 queries.