You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
subscribe USDT_FUTURE data_clients and exec_clients
the code is below
defon_start(self):
btcusdt_binance_id=InstrumentId.from_str("BTCUSDT-PERP.BINANCE")
ethusdt_binance_id=InstrumentId.from_str("ETHUSDT-PERP.BINANCE")
self.subscribe_quote_ticks(btcusdt_binance_id)
self.subscribe_quote_ticks(ethusdt_binance_id)
# Define the synthetic instrumentsynthetic=SyntheticInstrument(
symbol=Symbol("BTC-ETH:BINANCE"),
price_precision=8,
components=[btcusdt_binance_id, ethusdt_binance_id],
formula=f"{btcusdt_binance_id} - {ethusdt_binance_id}",
ts_event=self.clock.timestamp_ns(),
ts_init=self.clock.timestamp_ns(),
)
# Recommended to store the synthetic instruments ID somewhereself._synthetic_id=synthetic.id# Add the synthetic instrument for use by other componentsself.add_synthetic(synthetic)
# Subscribe to quotes for the synthetic instrumentself.subscribe_quote_ticks(self._synthetic_id)
self.log.info(f"🔔 subscribe quote_ticks: {self._synthetic_id}", LogColor.CYAN)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I want to synthetic two USDT_FUTURE instruments, but I received the below error:
I also tried to syntheticate two SPOT instruments, and they were successful.
Below is my code:
For SPOT:
For USDT-FUTURE:
Beta Was this translation helpful? Give feedback.
All reactions