Skip to content
All library documents

Polling Cryptocurrency Prices to Trade Within Configured Buy and Sell Ranges

Article Strategy library · Author: 永赢量化-1

Summary

This cryptocurrency trading script polls configured markets and submits orders when prices enter user-defined buy or sell ranges. It uses the ask price to check the buy range and the bid price to check the sell range, then places orders at the opposite side of the quoted market. Parameters define price and quantity precision, trade divisions, and per-market price bands. The code also fetches account balances, ticker and order-book data, divides potential trades into portions, and periodically cancels outstanding orders.

Position sizing is intended to limit holdings to 30% of the combined current holdings and estimated purchasable amount. The document offers implementation detail rather than evidence of profitability: it contains no reported backtest or performance analysis. Polling once per second can miss fast price moves, and repeated order placement or cancellation may create execution costs or operational issues. Its order and position logic also depends on exchange responses and configured market values, so deployment requires careful validation of how orders, balances, and cancellations behave on the chosen venue.

Key ideas

  • The strategy waits for polled prices to enter configured buy or sell ranges before placing orders.
  • It uses per-market settings for price precision, quantity precision, trade divisions, and price bands.
  • Buy and sell triggers check different sides of the quoted market and submit orders at the opposing quote.
  • The sizing logic aims to keep holdings within a stated 30% allocation limit and split trades into portions.
  • The document provides no performance evidence, and polling and order handling can introduce execution and operational risks.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.