Skip to content

Commit 6938443

Browse files
committed
fix websocket examples
1 parent ddb29a7 commit 6938443

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

examples/websocket/dictTicker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def on_ticker(self, data):
4545
polo = TickPolo()
4646
poloniex.logging.basicConfig()
4747
polo.logger.setLevel(poloniex.logging.DEBUG)
48-
polo.startws(['ticker'])
48+
polo.startws({'ticker': polo.on_ticker})
4949
for i in range(3):
5050
pprint(polo.ticker('BTC_LTC'))
5151
poloniex.sleep(10)

examples/websocket/stopLimit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def __init__(self, *args, **kwargs):
99
def on_ticker(self, msg):
1010
data = [float(dat) for dat in msg]
1111
# check stop orders
12-
mkt = self.channels[str(int(data[0]))]['name']
12+
mkt = self._getChannelName(str(int(data[0])))
1313
la = data[2]
1414
hb = data[3]
1515
for id in self.stopOrders:
@@ -98,6 +98,6 @@ def callbk(id):
9898
callback=callbk,
9999
# remove or set 'test' to false to place real orders
100100
test=True)
101-
test.startws(['ticker'])
101+
test.startws({'ticker': test.on_ticker})
102102
poloniex.sleep(120)
103103
test.stopws(3)

0 commit comments

Comments
 (0)