欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件高级功能研发区 → [求助]金字塔上面显示的时间是本地时间么

   

欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。    


  共有4655人关注过本帖树形打印复制链接

主题:[求助]金字塔上面显示的时间是本地时间么

帅哥哟,离线,有人找我吗?
wangwatercup
  1楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游侠 帖子:103 积分:532 威望:0 精华:0 注册:2010/11/8 18:27:01
[求助]金字塔上面显示的时间是本地时间么  发帖心情 Post By:2011/1/4 9:59:00 [只看该作者]

 设计了一个程序,从9:14:30开始,每50毫秒下一次单,结果在9:15:06之前的单子都没有下去,说是“已撤单报单被拒绝当前状态禁止此交易”,但是在9:15:07全部成交
于是想问一下:
(1)是因为金字塔显示的是本地的本机时间,所以才会有这6秒的延迟么?
(2)理论上每50毫秒下一次单,每秒应该有20次下单,但是实际上只有5次左右的下单,那么这时候说明金字塔是否是处理完本次任务之后才处理下一个任务,而且“过期不候”?

vbs代码如下:
dim dmHY,dmJYS,signal,buy_amount,IDaccount,RangeTick,RangeStoploss,Stoploss,NumberStoploss,Slide

dim orderid
dim ConSign
dim Filled
dim Remaining
dim Action
dim OrderType
dim LmtPrice
dim Account
dim Kaiping

dim BuyHoding
dim BuyCost
dim BuyTodayHoding
dim SellHoding
dim SellCost
dim SellTodayHoding
dim PNL
dim UseMargin

dim FirstTrade,StatusFirstTrade

sub b0()    '设置参数
'一定要在开盘之前运行本程序,
signal=1    '1 买 2 卖空
buy_amount=6    '开仓数量
IDaccount="40009975"    '帐号

dmHY="if01"        '合约
dmJYS="zj"        '交易所
RangeTick=.005  '报价与开盘价之间价差变动范围百分比
RangeStoploss=.02   '止损百分比

NumberStoploss=0
Slide=.2
end sub

Sub APPLICATION_VBAStart()
    FirstTrade=1                       
'一定要在未建仓之前运行本程序;
'如果想在开盘时最先成交,一定在9点14分之前启动本程序
    call b0
    call Application.SetTimer(1,1000) '1S触发一次
    call application.SetTimer (2,50)
    call marketdata.RegReportNotify(dmHY,dmJYS)
    msgbox "启动"
End Sub

Sub APPLICATION_Close()
    call Application.KillTimer(1)
    call Application.KillTimer(2)
    call marketdata.UnRegReportNotify(dmHY,dmJYS)   
End Sub

Sub APPLICATION_Timer(ID)
select case ID
    case 1
        call b3
    case 2
        call b1
end select
End Sub

Sub ORDER_OrderStatusEx(oOrderID,oStatus,oFilled,oRemaining,oPrice,oCode,oMarket,oOrderType,oAspect,oKaiping)
    StatusFirstTrade = oStatus
   
End Sub

Sub MARKETDATA_ReportNotify(ReportData) '争取在启动的时候下单
timePart=time
if timePart<=timevalue("09:14:30") or (timePart>timevalue("11:30:10") and timePart<=timevalue("12:59:50")) then
    exit sub
end if

if FirstTrade=1 and (isempty(StatusFirstTrade) or StatusFirstTrade="Cancelled" or StatusFirstTrade="Inactive") then
    Set rpt = marketdata.GetReportData(dmHY,dmJYS)'得到这个品种的行情报价
    PriceOpen=rpt.Open
    select case signal
        case 1
            Ssx_Price_Buy=rpt.SellPrice1+Slide
            if abs((Ssx_Price_Buy-PriceOpen)/PriceOpen)<=RangeTick then
                call Order.Buy(0,buy_amount,Ssx_Price_Buy,0,dmHY,dmJYS,"",0)   
            end if       
        case 2
            Ssx_Price_Sell=rpt.BuyPrice1-Slide
            if abs((Ssx_Price_Sell-PriceOpen)/PriceOpen)<=RangeTick then
                call Order.BuyShort(0,buy_amount,Ssx_Price_Sell,0,dmHY,dmJYS,"",0)
            end if
    end select
    if StatusFirstTrade ="Filled" or StatusFirstTrade ="Tradeing" or StatusFirstTrade ="Submitted" or  StatusFirstTrade ="PreSubmitted" then
        FirstTrade = 0    '不会存在下了指令却无法成为委托的情况,因为如果能获得注册的品种发出的价格,则一定是在交易时间
        call document.WritePrivateProfileFloat("operation", "timePartReportNotify", timePart, "C:\out.ini")
    end if
end if
end sub

sub b1()    '争取在开盘的时候下第一单
timePart=time
if timePart<=timevalue("09:14:40") or timePart>=timevalue("9:15:10") then
    exit sub
end if

if FirstTrade=1 and (isempty(StatusFirstTrade) or StatusFirstTrade="Cancelled" or StatusFirstTrade="Inactive") then
    Set rpt = marketdata.GetReportData(dmHY,dmJYS)'得到这个品种的行情报价
    PriceOpen=rpt.open
    select case signal
        case 1
            Ssx_Price_Buy=rpt.SellPrice1+Slide
            if abs((Ssx_Price_Buy-PriceOpen)/PriceOpen)<=RangeTick then
                call Order.Buy(0,buy_amount,Ssx_Price_Buy,0,dmHY,dmJYS,"",0)   
            end if       
        case 2
            Ssx_Price_Sell=rpt.BuyPrice1-Slide
            if abs((Ssx_Price_Sell-PriceOpen)/PriceOpen)<=RangeTick then
                call Order.BuyShort(0,buy_amount,Ssx_Price_Sell,0,dmHY,dmJYS,"",0)
            end if
    end select
    if StatusFirstTrade ="Filled" or StatusFirstTrade ="Tradeing" or StatusFirstTrade ="Submitted" or  StatusFirstTrade ="PreSubmitted" then
        FirstTrade = 0    '不会存在下了指令却无法成为委托的情况,因为如果能获得注册的品种发出的价格,则一定是在交易时间
        call document.WritePrivateProfileFloat("operation", "timePart", timePart, "C:\out.ini")
    end if
end if

end sub

 回到顶部
帅哥哟,离线,有人找我吗?
王锋
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:罗宾汉 帖子:11808 积分:20695 威望:0 精华:10 注册:2009/8/18 8:15:13
  发帖心情 Post By:2011/1/5 9:44:09 [只看该作者]

是本地时间。

实际上只有5次左右的下单,你看看是否跟行情有关,因为只有0.5秒一笔



金字塔—专业程序化软件提供商

金字塔-技术部

-----------------------------------------------------------------------------------------------------

工作时间:周一至周五 08:30 - 17:30   周末及法定节假日休息

Email:service@weistock.com
 回到顶部
帅哥哟,离线,有人找我吗?
wangwatercup
  3楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游侠 帖子:103 积分:532 威望:0 精华:0 注册:2010/11/8 18:27:01
  发帖心情 Post By:2011/1/5 12:59:30 [只看该作者]

 多谢!!

 回到顶部