Skip to content
This repository has been archived by the owner on Jan 5, 2021. It is now read-only.

Commit

Permalink
changed print to print() to be Python 3 compatible (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwfu authored and blampe committed Aug 14, 2016
1 parent 298f562 commit 26d027a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions demo/fancy_marketdata
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ def watcher(msg):
# show Bid and Ask quotes
def my_BidAsk(msg):
if msg.field == 1:
print '%s:%s: bid: %s' % (contractTuple[0],
contractTuple[6], msg.price)
print ('%s:%s: bid: %s' % (contractTuple[0],
contractTuple[6], msg.price))
elif msg.field == 2:
print '%s:%s: ask: %s' % (contractTuple[0], contractTuple[6], msg.price)
print ('%s:%s: ask: %s' % (contractTuple[0], contractTuple[6], msg.price))

def makeStkContract(contractTuple):
newContract = Contract()
Expand All @@ -26,7 +26,7 @@ def makeStkContract(contractTuple):
newContract.m_expiry = contractTuple[4]
newContract.m_strike = contractTuple[5]
newContract.m_right = contractTuple[6]
print 'Contract Values:%s,%s,%s,%s,%s,%s,%s:' % contractTuple
print ('Contract Values:%s,%s,%s,%s,%s,%s,%s:' % contractTuple)
return newContract

if __name__ == '__main__':
Expand All @@ -48,10 +48,10 @@ if __name__ == '__main__':
#contractTuple = ('ES', 'FOP', 'GLOBEX', 'USD', '20070920', 1460.0, 'CALL')
#contractTuple = ('EUR', 'CASH', 'IDEALPRO', 'USD', '', 0.0, '')
stkContract = makeStkContract(contractTuple)
print '* * * * REQUESTING MARKET DATA * * * *'
print ('* * * * REQUESTING MARKET DATA * * * *')
con.reqMktData(tickId, stkContract, '', False)
sleep(15)
print '* * * * CANCELING MARKET DATA * * * *'
print ('* * * * CANCELING MARKET DATA * * * *')
con.cancelMktData(tickId)
sleep(1)
con.disconnect()
Expand Down

0 comments on commit 26d027a

Please sign in to comment.