Skip to content

Instantly share code, notes, and snippets.

@christianjohnson
Created April 19, 2011 05:34
Show Gist options
  • Save christianjohnson/926863 to your computer and use it in GitHub Desktop.
Save christianjohnson/926863 to your computer and use it in GitHub Desktop.
Not getting correct quote output - something I'm missing?
Request: <request><account>XXXXXXXXXXXX</account><quote><symbol>AAPL</symbol><symbol>SLV</symbol><delayed>false</delayed></quote></request>
Response:
{u'@id': u'XXXXXXXXXXXXXXXX',
u'quotes': {u'instrumentquote': {u'greeks': None,
u'instrument': {u'desc': u'APPLE INC',
u'exch': u'NSD',
u'sectyp': u'CS',
u'sym': u'AAPL'},
u'quote': {u'askprice': u'332.0',
u'bidprice': u'325.05',
u'change': u'4.39',
u'extendedquote': {u'asksize': u'0',
u'bidsize': u'0',
u'dividenddata': {u'amt': u'0.0',
u'exdate': u'2005-05-11T00:00:00-04:00',
u'yield': u'4.9E-324'},
u'earningspershare': u'17.91',
u'high52price': u'364.9',
u'highprice': u'332.23',
u'low52price': u'199.25',
u'lowprice': u'320.16',
u'openprice': u'326.1',
u'prevclose': u'327.46',
u'priceearningsratio': u'18.53',
u'sessionvolume': u'21208766',
u'volume': u'21782061'},
u'lastprice': u'331.85',
u'pctchange': u'1.34'},
u'unknownsymbol': u'false'}}}
@marchon
Copy link

marchon commented Apr 20, 2011

    You need to wrap multiple SYMBOLS elements   (symbol)AAPL(/symbol) in a SYMBOLS tag

    (symbols) 
    (symbol)AAPL(/symbol)
    (symbol)SLV(/symbol)
    (/symbols)

    here is my exact python request and response (account # removed)  

    body = ''' 
    
    XXXXXXXXX    
    
    
    AAPL
    SLV
    
    false
    '''

   
  
    
     
      
      
        APPLE INC
        NSD
        CS
        AAPL
      
      
        355.9
        355.8
        4.55
        
          2
          1
          
            0.0
            2005-05-11T00:00:00-04:00
            4.9E-324
          
          17.91
          364.9
          345.75
          199.25
          341.5
          343.51
          337.86
          19.12
          19109969
          24710115
        
        342.41
        1.35
      
      false
    
    
    
      
      
        ISHARES SILVER TRUST
        AMX
        CS
        SLV
      
      
        44.15
        44.14
        1.121
        
          50
          3
          
            0.0
            4.9E-324
          
          0.0
          44.31
          44.31
          16.73
          43.15
          43.66
          43.0
          0.0
          87113289
          89563423
        
        44.121
        2.61
      
      false
    
  
  
 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment