Skip to content

Instantly share code, notes, and snippets.

@cardosofede
Created February 23, 2023 21:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cardosofede/1a37db4ebc02440d8fb1352fc324e531 to your computer and use it in GitHub Desktop.
Save cardosofede/1a37db4ebc02440d8fb1352fc324e531 to your computer and use it in GitHub Desktop.
Quickstart Guide: Exercise I
from hummingbot.strategy.script_strategy_base import ScriptStrategyBase
class QuickstartScript(ScriptStrategyBase):
# It is best to first use a paper trade exchange connector
# while coding your strategy, once you are happy with it
# then switch to real one.
markets = {"binance_paper_trade": {"BTC-USDT"}}
def on_tick(self):
price = self.connectors["binance_paper_trade"].get_mid_price("BTC-USDT")
msg = f"Bitcoin price: ${price}"
self.logger().info(msg)
self.notify_hb_app_with_timestamp(msg)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment