Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix hello-world-bot.py #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions btcebot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,13 @@ def addTrader(self, trader):

def addDepthHandler(self, handler, pairs):
for p in pairs:
self.api.validate_pair(p)
self.api.apiInfo.validate_pair(p)

self.depthHandlers.append((handler, pairs))

def addTradeHistoryHandler(self, handler, pairs):
for p in pairs:
self.api.validate_pair(p)
self.api.apiInfo.validate_pair(p)

self.tradeHistoryHandlers.append((handler, pairs))

Expand Down
7 changes: 4 additions & 3 deletions samples/hello-world-bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,16 @@ def onBotError(msg, tracebackText):
def run(key_file, buy_floor, sell_ceiling, live_trades):
# Load the keys and create an API object from the first one.
handler = btceapi.KeyHandler(key_file)
key = handler.getKeys()[0]
key = handler.keys[0]
print "Trading with key %s" % key
api = btceapi.TradeAPI(key, handler)
api = btceapi.TradeAPI(key, handler,btceapi.BTCEConnection())

# Create a trader that handles LTC/USD trades in the given range.
trader = RangeTrader(api, "ltc_usd", buy_floor, sell_ceiling, live_trades)

# Create a bot and add the trader to it.
bot = btcebot.Bot()

bot = btcebot.Bot(api)
bot.addTrader(trader)

# Add an error handler so we can print info about any failures
Expand Down