Building a Spot Crypto Strategy from Price Changes in a Visual Module
Summary
This tutorial shows how to assemble a basic spot cryptocurrency strategy with visual programming blocks. It tracks a reference price and buys when the market rises by a threshold, using a share of the account’s quote currency; after a threshold decline, it sells a share of the base currency. A reusable spot-trading module handles order placement and retries, keeping the strategy logic compact.
The accompanying JavaScript example uses a 2% threshold and resets the reference price after each trade. The article describes backtesting from October 2018 across both choppy and trending conditions, and compares results under different starting balances of currency and cash. It provides no performance figures or detailed risk analysis, so the backtest is only a preliminary illustration. Results depend on initial asset allocation, and the document leaves optimization and practical considerations such as fees and live execution to the reader.
Key ideas
- The strategy buys after a threshold rise from its reference price and sells after a threshold fall.
- Each trade uses a fraction of the account’s available quote currency or base currency.
- The reference price resets to the latest price after a trade.
- Starting balances affect the backtest, so asset allocation is an important parameter.
- The reported backtest is preliminary and does not establish live performance.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.