Rss & SiteMap

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

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

标题:若无持仓,查询持仓的结果是0,还是空

1楼
chendong 发表于:2016/1/5 19:33:12
Sub GetHoldByCode(sAccount,sCode,sMarket)    
 dim i
 dim BuyHolding
 dim BuyCost
 dim BuyTodayHolding
 dim SellHolding
 dim SellCost
 dim SellTodayHolding
 dim PNL
 dim UseMargin 
 dim Code
 dim Market
 
  On Error resume Next
  AccountStatus=Order.Account2(2,sAccount)     '检测账户是否登陆,如果没有登陆就退出
  'application.MsgOut sCode & "," & sMarket & "," & sAccount & ",NextCode:" & NextCode & ",账户状态:" & AccountStatus
    if AccountStatus=255 Or AccountStatus="" then
     exit sub
    end if 
    Call Order.HoldingInfoByCode2(sCode,sMarket,BuyHolding,BuyCost,BuyTodayHolding,SellHolding,SellCost,SellTodayHolding,PNL,UseMargin,sAccount)
 BuyHold=BuyHolding
 SellHold=SellHolding

End Sub


这段代码是用来查账户持仓的,请问,若账户没有持仓,那BuyHold的值是0,还是为空。若为空值,如何转为0
2楼
王锋 发表于:2016/1/5 21:25:52
http://www.weistock.com:8080/vip/forum.php?mod=viewthread&tid=1557&extra=page%3D1
共2 条记录, 每页显示 10 条, 页签: [1]


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