Renko Trading: Charts, Statistics and Python
Compare brick sizes on one price path, explore historical forex and crypto statistics, and test Renko signals in Python.
Tools
Research
Practical guides and Python
- How to Choose a Renko Brick Size
- Renko Reversal Rules
- ATR Renko: Calculation and Timing
- Renko Backtest Mistakes
- Renko Paper Bot in Python
Advanced guides
One price path, different bricks
Synthetic BTC example in USD. Both charts share a price scale. Change the 60 and 120 USD defaults or replay one observation at a time.
How is a Renko brick formed?
A time candle summarizes a fixed interval. A Renko brick forms when an observed price reaches or crosses a fixed threshold. Here the first observation sets the anchor. Later bricks use the most recent brick close as their reference.
Continuation, reversal and price gaps
With a brick size of 10 and a starting price of 100, a price of 110 makes the first up brick. A price of 120 makes the next one. A decline to 110 leaves the trend intact. At 100 the first down brick runs from 110 to 100. This two-brick reversal rule keeps consecutive bricks from overlapping.
A price gap can generate several bricks at once. They share the same source observation and are stacked in one column in the demo. The dashed line shows observed prices, and the colored blocks show the bricks.
Fixed size, percentages and ATR
A fixed absolute size is directly reproducible. A size derived from a starting percentage remains fixed during the run. An ATR-based variant also depends on lookback, data resolution and when size is recalculated. Set those rules before comparing results.
Data resolution and execution
Daily and second-level samples can omit movements between observations. Tick sequences preserve the order of the observed prices. OHLC highs and lows alone do not identify which threshold was hit first. Bricks provide signals. The Python example fills a signal at the next observed bid or ask at the earliest, including modeled costs.
Renko Studies
Compare trade ticks and one-second prices
One sequence of BTC/USD trades, two resolutions and six brick sizes.
What do historical forex and crypto data show?
In this quarter, a size of 0.50% of the first observation produces 19 EUR/USD bricks, 383 BTC/USDT bricks and 495 ETH/USDT bricks.
Window: 1 October through 31 December 2024. Forex uses available New York noon rates. Crypto uses Bybit spot daily UTC closes, including weekends. Missing FX values are omitted. The first value is the anchor. Sizes are 25, 50 and 100 basis points of the initial quote, rounded to four decimal places for EUR/USD and two for crypto. They remain fixed throughout.
| Market | Observations | Size (bp) | Brick size | Bricks | Up / down | Reversals | Days with bricks | Median run |
|---|---|---|---|---|---|---|---|---|
| EUR/USD | 62 | 25 | 0.0028 | 43 | 9 / 34 | 8 | 28 | 3 |
| EUR/USD | 62 | 50 | 0.0055 | 19 | 3 / 16 | 4 | 14 | 3 |
| EUR/USD | 62 | 100 | 0.0111 | 6 | 0 / 6 | 0 | 6 | 6 |
| BTC/USDT | 92 | 25 | 152.03 | 834 | 524 / 310 | 33 | 80 | 15.5 |
| BTC/USDT | 92 | 50 | 304.06 | 383 | 245 / 138 | 27 | 69 | 11.0 |
| BTC/USDT | 92 | 100 | 608.12 | 166 | 110 / 56 | 21 | 58 | 5.5 |
| ETH/USDT | 92 | 25 | 6.12 | 1066 | 606 / 460 | 40 | 80 | 17 |
| ETH/USDT | 92 | 50 | 12.24 | 495 | 284 / 211 | 36 | 74 | 8 |
| ETH/USDT | 92 | 100 | 24.48 | 215 | 126 / 89 | 24 | 63 | 6 |
Counts cover completed bricks, reversals between consecutive bricks and observations with at least one brick. Median run includes initial and final runs in the same-direction sequence. Different sampling calendars and observation times limit cross-market comparisons. The statistics describe this quarter and do not measure trading returns or intraday activity.
Sources: Federal Reserve / FRED DEXUSEU ยท Bybit Spot Kline API
Python code for Renko backtests and paper bots
The standard-library example reads chronological bid and ask quotes. Their midpoint forms fixed-size bricks. Once the EMAs warm up, the strategy switches between long and flat. Bricks from one observation are processed together. The simulator buys at the next ask and sells at the next bid, with adverse slippage and fees on each side. It reports open positions and unfilled signals at the end of the data.
Paper mode accepts the same CSV over standard input. It emits signals and simulated executions as JSON lines. A separate data adapter can write the rows. The example uses no account credentials.
python renko_lab.py backtest renko-demo-quotes.csv --size 60 --fast 3 --slow 6
python renko_lab.py paper - --size 60 --fast 3 --slow 6
python renko_research.py
Feed paper mode from a process that emits timestamp,bid,ask as its first line. The research script re-fetches both data sources and needs internet access.