以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://weistock.com/bbs/list.asp?boardid=4) ---- 关于QQ发信息 (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=156155) |
-- 作者:zwdqx -- 发布时间:2017/7/22 22:25:32 -- 关于QQ发信息 请问QQ信息发送自定义函数中你自己的群显示名字、某个人的qq显示名字 是不是填群的名字和个人在群中的名字? Function
QQMSGX(Formula,QQNum,QQMSG)
QQMSG=document.GetExtString("QQSTR")
Set obj =
CreateObject("WWSCommon.TCGroup")
bq = " 交易系统信号发布 "
mxmsg = bq &" " & Date
&" " & Time & vbCrLf & " 信号" & " " & QQMSG
call obj.TransMessage("你自己的群显示名字",
mxmsg)
Set obj = Nothing
Set obj =
CreateObject("WWSCommon.TCGroup")
call obj.TransMessage("某个人的qq显示名字",
mxmsg)
Set obj = Nothing
End Function
|
-- 作者:wenarm -- 发布时间:2017/7/24 8:30:57 -- 是的 |
-- 作者:zwdqx -- 发布时间:2017/7/24 12:20:43 -- 是用QQ号码、群号,还是用昵称 |
-- 作者:wenarm -- 发布时间:2017/7/24 13:12:50 -- qq对话框左上角的名称 |
-- 作者:zwdqx -- 发布时间:2017/7/25 21:51:22 -- QQ的对话窗口是不是一直要处于打开状态。 |
-- 作者:wenarm -- 发布时间:2017/7/25 22:19:33 -- 是的, |
-- 作者:zwdqx -- 发布时间:2017/9/28 6:51:23 -- 设置QQ过程中,打开function发现里面有以下内容,是不是要将其删除,只把QQ相关的内容写进去。 \'******************************************************************************************* \'该模块主要用来保存自定义公式函数主函数,不要拿做他用 \'******************************************************************************************* Function TriangleShape(Formula,Cyc,SCyc,ECyc) \'msgbox cyc & "-" & scyc & "-" & ecyc
\'该函数计算当前位置图形是否是三角形突破,如果是则返回1,否则返回0。该函数只有在选股时才能使用。
TriangleShape=0
\'如果是分时数据或者分笔成交那么直接返回
If Formula.ParentGrid.DataType = 0 or Formula.ParentGrid.CycType = 10 Then
Exit Function
End If
\'得到K线数据对象
Set History = Formula.ParentGrid.GetHistoryData()
If History.Count < Cyc+3 Then
Exit Function
End If
\'为了加快处理速度,只有公式在执行最后一个周期时使用。这就意味着只能在选股时使用该函数
\'如果你在公式测试中使用,请注释掉以下语句
If Formula.IndexData < History.Count-1 Then Exit Function
\'下面的代码判断当前图形是否可能为三角形态
\'开始位置SCyc周期内的高低价格为三角形态的开始
StartPos = Formula.IndexData - (Cyc+2)
EndPos = Formula.IndexData-3
High = History.High(StartPos)
Low = History.Low(StartPos)
For I = StartPos To StartPos+SCyc
If History.High(I) > High Then
High = History.High(I)
End If
If History.Low(i) < Low Then
Low = History.Low(I)
End If
Next
\'ECyc周期内的周期高低价格为三角的结束
High2 = History.High(EndPos - ECyc)
Low2 = History.Low(Endpos-ECyc)
for i = endpos - ECyc to endpos
If History.High(I) > High2 Then
High2 = History.High(I)
End If
If History.Low(i) < Low2 Then
Low2 = History.Low(I)
End If
next
\'最后图形范围为开始图形的1/2的话,初步表明是可以做为三角形的结束
if high2-low2 <= 0 then
exit function
end if
If (High-Low) / (high2-low2) < 2 Then
Exit Function
End if
if high2 > high or low2 < low then
exit function
end if
\'如果中间有超过三角形边界的地方,三角图形则不成立
\'用斜率计算图形边界
\'计算上边界
Slope = (high2-high) / (Endpos-StartPos)
b = high - slope * startpos
for i = startpos+SCyc to endpos
temp = slope * i + b
price = (history.open(i)+history.close(i))/2
if temp < price then
exit function
end if
next
\'计算下边界
slope = (low2-low) / (endpos - startpos)
b = low - slope * startpos
for i = startpos to endpos-3
temp = slope * i + b
price = (history.open(i)+history.close(i))/2
if temp > price then
exit function
end if
next
’如果3日后的价格突破了三角型结束的上边线认为突破成功
if history.close(Formula.IndexData) > high2 then
TriangleShape = 1
end if End Function \'计算逐周期模式下指定周期长度的收盘价均价 Function CU_MA2(Formula,cyc) \'得到K线数据对象
Set History = Formula.ParentGrid.GetHistoryData()
\'若当前周期尚未到计算周期,不参与计算
if Formula.IndexData < cyc-1 then
CU_MA2 = 0
exit function
end if
DataCount = 0 for i = Formula.IndexData-cyc+1 to Formula.IndexData
\'累加收盘价
DataCount = DataCount + history.close(i) next
CU_MA2 = DataCount / cyc End Function \'计算序列模式下指定周期长度的收盘价均价 Function CU_MA1(Formula,CLOSE,CYC) CU_MA1=0 \'防止公式逐周期模式时调用 If Formula.WorkMode = 0 Then Exit Function End If \'CLOSE数组数据长度一定会与Formula.DataSize-1相等 DataCount = UBound(CLOSE) If DataCount <> Formula.DataSize-1 Then Exit Function End If \'定义一个计算返回的数组 Dim ResultMa Redim ResultMa(DataCount) For i = Cyc-1 To Formula.DataSize-1 Count = 0 For k = i-(Cyc-1) To i Count = Count + CLOSE(k) Next ResultMa(i) = Count / Cyc Next \'返回一个计算完毕的均线数组 CU_MA1 = ResultMa End Function |
-- 作者:zwdqx -- 发布时间:2017/9/28 6:51:43 -- QQ的内容这样写对不对? Function QQMSGX(Formula,QQNum,QQMSG) QQMSG=document.GetExtString("QQSTR") Set obj = CreateObject("WWSCommon.TCGroup") bq = " 交易系统信号发布 " mxmsg = bq &" " & Date &" " & Time & vbCrLf & " 信号" & " " & QQMSG call obj.TransMessage("华盈财富", mxmsg) Set obj = Nothing Set obj = CreateObject("WWSCommon.TCGroup") call obj.TransMessage("咚咚", mxmsg) Set obj = Nothing End Function |
-- 作者:wenarm -- 发布时间:2017/9/28 8:54:21 -- 7楼的内容和你的消息的没有任何关系,不要动它。 你自己新建一个工程或者模块。但是存放你的消息代码 |
-- 作者:zwdqx -- 发布时间:2017/9/29 6:41:05 -- 是不是就这样啊,华盈财富是群名,咚咚是我的网名,然后怎么运行,这个模块建好了,在策略中怎么写? |