金字塔[VBA策略] 自行處理拆單的算法處理模塊范例模板 PEL范例源碼[金字塔模型]
: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">
: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">
: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">
: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">
: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">
: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">
: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">
: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">
: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">
: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">
: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">
: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">
: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">
: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">
: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">
: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">
: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">
: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">
: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">
: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">
: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">
: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">
: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">
: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">
: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">
: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">
: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">
\'定時器觸發事件函數,當有符合觸發條件的時間出現后將調用這里,本范例是5秒循環調用一次
Sub APPLICATION_Timer(ID)
?If Id = 0 Then
??If strCode.Count > 0 Then
???\'定時器中的代碼比較簡單,只要循環將數組的下單直接發送交易即可
???Code = strCode.GetAt(0)
???Market = strMarket.GetAt(0)
???Vol = arVol.GetAt(0)
???OrderType = arOrderType.GetAt(0)
???
???Set Report1 = marketdata.GetReportData(Code,Market)
???If Report1 is nothing Then
????Exit Sub
???End If
???
???If OrderType = 0 Then
????Price = Report1.SellPrice1 \'獲取當前對手價格
????If Price = 0 Then \'防止漲停板判斷
?????Price = Report1.NewPrice
????End If
????call Order.Buy(0,Vol,Price,0,Code,Market,"",0)
???ElseIf OrderType = 1 Then
????Price = Report1.BuyPrice1
????If Price = 0 Then
?????Price = Report1.NewPrice
????End If
????call Order.Sell(0,Vol,Price,0,Code,Market,"",0)
???ElseIf OrderType = 2 Then
????Price = Report1.BuyPrice1
????If Price = 0 Then
?????Price = Report1.NewPrice
????End If
????call Order.BuyShort(0,Vol,Price,0,Code,Market,"",0)
???ElseIf OrderType = 3 Then
????Price = Report1.SellPrice1
????If Price = 0 Then
?????Price = Report1.NewPrice
????End If
????call Order.Sell(0,Vol,Price,0,Code,Market,"",0)
???End If
???
???\'處理完畢刪除數組隊列
???strCode.RemoveAt(0)
???strMarket.RemoveAt(0)
???arVol.RemoveAt(0)
???arOrderType.RemoveAt(0)
??End If
?End If
End Sub
Sub APPLICATION_Timer(ID)
?If Id = 0 Then
??If strCode.Count > 0 Then
???\'定時器中的代碼比較簡單,只要循環將數組的下單直接發送交易即可
???Code = strCode.GetAt(0)
???Market = strMarket.GetAt(0)
???Vol = arVol.GetAt(0)
???OrderType = arOrderType.GetAt(0)
???
???Set Report1 = marketdata.GetReportData(Code,Market)
???If Report1 is nothing Then
????Exit Sub
???End If
???
???If OrderType = 0 Then
????Price = Report1.SellPrice1 \'獲取當前對手價格
????If Price = 0 Then \'防止漲停板判斷
?????Price = Report1.NewPrice
????End If
????call Order.Buy(0,Vol,Price,0,Code,Market,"",0)
???ElseIf OrderType = 1 Then
????Price = Report1.BuyPrice1
????If Price = 0 Then
?????Price = Report1.NewPrice
????End If
????call Order.Sell(0,Vol,Price,0,Code,Market,"",0)
???ElseIf OrderType = 2 Then
????Price = Report1.BuyPrice1
????If Price = 0 Then
?????Price = Report1.NewPrice
????End If
????call Order.BuyShort(0,Vol,Price,0,Code,Market,"",0)
???ElseIf OrderType = 3 Then
????Price = Report1.SellPrice1
????If Price = 0 Then
?????Price = Report1.NewPrice
????End If
????call Order.Sell(0,Vol,Price,0,Code,Market,"",0)
???End If
???
???\'處理完畢刪除數組隊列
???strCode.RemoveAt(0)
???strMarket.RemoveAt(0)
???arVol.RemoveAt(0)
???arOrderType.RemoveAt(0)
??End If
?End If
End Sub
?
?
?
{別忘了將本網告訴您身邊的朋友,向朋友傳達有用資料,也是一種人情,你朋友會感謝你的。}
?
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 511411198 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容