Skip to content

Commit 9899212

Browse files
CopilotDaveSkender
andauthored
chore: RenkoAtr BufferList removed (#1640)
Signed-off-by: Dave Skender <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: DaveSkender <[email protected]>
1 parent 7869913 commit 9899212

File tree

3 files changed

+48
-51
lines changed

3 files changed

+48
-51
lines changed

docs/_indicators/Renko.md

Lines changed: 44 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,6 @@ You must have at least two periods of `quotes` to cover the warmup periods; howe
3838

3939
**`EndType.HighLow`** - Brick change threshold measured from `High` and `Low` price
4040

41-
## Chaining
42-
43-
Results are based in `IQuote` and can be further used in any indicator.
44-
45-
```csharp
46-
// example
47-
var results = quotes
48-
.ToRenko(..)
49-
.ToRsi(..);
50-
```
51-
52-
This indicator must be generated from `quotes` and **cannot** be generated from results of another chain-enabled indicator or method.
53-
5441
## Response
5542

5643
```csharp
@@ -90,43 +77,23 @@ Each result record represents one Renko brick.
9077

9178
See [Utilities and helpers]({{site.baseurl}}/utilities#utilities-for-indicator-results) for more information.
9279

93-
## ATR Variant
94-
95-
```csharp
96-
// C# usage syntax
97-
IReadOnlyList<RenkoResult> results =
98-
quotes.ToRenkoAtr(atrPeriods, endType);
99-
```
100-
101-
### Parameters for ATR
102-
103-
**`atrPeriod`** _`int`_ - Number of lookback periods (`A`) for ATR evaluation. Must be greater than 0.
104-
105-
**`endType`** _`EndType`_ - See options below. Default is `EndType.Close`
106-
107-
#### Historical quotes requirements for ATR
108-
109-
You must have at least `A+100` periods of `quotes`.
110-
111-
`quotes` is a collection of generic `TQuote` historical price quotes. It should have a consistent frequency (day, hour, minute, etc). See [the Guide]({{site.baseurl}}/guide/#historical-quotes) for more information.
80+
## Chaining
11281

113-
## Response for ATR
82+
Results are based in `IQuote` and can be further used in any indicator.
11483

11584
```csharp
116-
IReadOnlyList<RenkoResult>
85+
// example
86+
var results = quotes
87+
.ToRenko(..)
88+
.ToRsi(..);
11789
```
11890

119-
- This method returns a time series of all available indicator values for the `quotes` provided.
120-
- It does not return a single incremental indicator value.
121-
122-
## Streaming and real-time usage for ATR variant
123-
124-
**⚠️ Streaming not supported for ATR variant**: The `ToRenkoAtr()` method requires calculating ATR across the full dataset to determine the final brick size. Incremental streaming (StreamHub) or buffer (BufferList) implementations would require buffering all historical quotes and recalculating the entire Renko series on each new data point, which defeats the purpose of incremental processing.
125-
126-
**Recommendation**: Use the Series implementation (`ToRenkoAtr()`) with periodic batch recalculation. For real-time scenarios with dynamic brick sizing, consider recalculating at appropriate intervals rather than on every tick. Alternatively, use the fixed brick size variant (`ToRenko()`) which fully supports streaming and buffering (see below).
91+
This indicator must be generated from `quotes` and **cannot** be generated from results of another chain-enabled indicator or method.
12792

12893
## Streaming
12994

95+
**Fixed brick size only** - Streaming implementations are only available for fixed brick size Renko. The [ATR variant](#atr-variant) requires full dataset processing and does not support incremental streaming.
96+
13097
Subscribe to a `QuoteHub` for streaming scenarios:
13198

13299
```csharp
@@ -141,8 +108,6 @@ foreach (Quote quote in quotes) // simulating stream
141108
IReadOnlyList<RenkoResult> results = observer.Results;
142109
```
143110

144-
## Buffering
145-
146111
Use a `BufferList` for incremental processing:
147112

148113
```csharp
@@ -156,8 +121,40 @@ foreach (Quote quote in quotes) // simulating incremental data
156121
IReadOnlyList<RenkoResult> results = buffer;
157122
```
158123

159-
The buffering approach is ideal for growing datasets where quotes arrive incrementally over time.
124+
## ATR Variant
125+
126+
```csharp
127+
// C# usage syntax
128+
IReadOnlyList<RenkoResult> results =
129+
quotes.ToRenkoAtr(atrPeriods, endType);
130+
```
131+
132+
### Parameters for ATR
133+
134+
**`atrPeriod`** _`int`_ - Number of lookback periods (`A`) for ATR evaluation. Must be greater than 0.
135+
136+
**`endType`** _`EndType`_ - See options below. Default is `EndType.Close`
137+
138+
#### Historical quotes requirements for ATR
139+
140+
You must have at least `A+100` periods of `quotes`.
141+
142+
`quotes` is a collection of generic `TQuote` historical price quotes. It should have a consistent frequency (day, hour, minute, etc). See [the Guide]({{site.baseurl}}/guide/#historical-quotes) for more information.
143+
144+
### Response for ATR
145+
146+
```csharp
147+
IReadOnlyList<RenkoResult>
148+
```
149+
150+
- This method returns a time series of all available indicator values for the `quotes` provided.
151+
- It does not return a single incremental indicator value.
152+
- See [RenkoResult](#renkoresult) above for detailed response structure.
160153

161-
> &#128681; **Warning**: Unlike most indicators in this library, this indicator DOES NOT return the same number of elements as there are in the historical quotes. Renko bricks are added to the results once the `brickSize` change is achieved. For example, if it takes 3 days for a $2.50 price change to occur an entry is made on the third day while the first two are skipped. If a period change occurs at multiples of `brickSize`, multiple bricks are drawn with the same `Timestamp`. See [online documentation](https://www.investopedia.com/terms/r/renkochart.asp) for more information.
162-
>
163154
> &#128073; **Repaint warning**: When using the `ToRenkoAtr()` variant, the last [Average True Range (ATR)]({{site.baseurl}}/indicators/Atr/#content) value is used to set `brickSize`. Since the ATR changes over time, historical bricks will be repainted as new periods are added or updated in `quotes`.
155+
156+
### Streaming limitations for ATR
157+
158+
**ATR variant does not support streaming**: The `ToRenkoAtr()` method requires calculating ATR across the full dataset to determine the final brick size. Incremental streaming would require buffering all historical quotes and recalculating the entire Renko series on each new data point, which defeats the purpose of incremental processing.
159+
160+
**Recommendation**: Use the Series implementation (`ToRenkoAtr()`) with periodic batch recalculation. For real-time scenarios, consider recalculating at appropriate intervals rather than on every tick.

specs/001-develop-streaming-indicators/tasks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ Note on former deferrals: Some indicators were previously marked as deferred due
162162
- [x] **T052** Implement Pvo BufferList in `src/m-r/Pvo/Pvo.BufferList.cs`
163163
- [x] **T053** Implement QuotePart BufferList in `src/_common/QuotePart/QuotePart.BufferList.cs`
164164
- [x] **T054** Implement Renko BufferList in `src/m-r/Renko/Renko.BufferList.cs`
165-
- [ ] **T055** Implement RenkoAtr BufferList in `src/m-r/RenkoAtr/RenkoAtr.BufferList.cs`
165+
- [ ] **T055** ~~Implement RenkoAtr BufferList~~ **NOT IMPLEMENTED** — ATR calculation requires full dataset to determine final brick size. Buffering all quotes and recalculating entire Renko series on each add would defeat the purpose of incremental processing. Series-only implementation maintained.
166166
- [x] **T056** Implement Roc BufferList in `src/m-r/Roc/Roc.BufferList.cs`
167167
- [x] **T057** Implement RocWb BufferList in `src/m-r/RocWb/RocWb.BufferList.cs`
168168
- [x] **T058** Implement RollingPivots BufferList in `src/m-r/RollingPivots/RollingPivots.BufferList.cs`

src/m-r/RenkoAtr/RenkoAtr.Catalog.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static partial class RenkoAtr
2929
.WithMethodName("ToRenkoAtr")
3030
.Build();
3131

32-
// BufferList and StreamHub not implemented - ATR calculation requires full dataset
33-
// to determine final brick size. Incremental processing would require buffering all
34-
// quotes and recalculating entire series on each add. Series-only implementation maintained.
32+
// BufferList and StreamHub not implemented - would require buffering all quotes
33+
// and recalculating entire Renko series on each add to maintain ATR accuracy.
34+
// Series-only implementation maintained for correctness.
3535
}

0 commit comments

Comments
 (0)