docs: remove C# Implementation Considerations sections, clean up temp scripts, reorganize test files

- Remove 'C# Implementation Considerations' sections from 34 indicator .md files
- Delete 29 temp PowerShell scripts (_fix_mojibake.ps1, _hex_scan.ps1, etc.)
- Move test files into tests/ subdirectories for consistent project structure
- Add trader-focused bullet points to indicator documentation
This commit is contained in:
Miha Kralj
2026-03-12 12:34:16 -07:00
parent 8937b0c0fa
commit 060649192f
1149 changed files with 1780 additions and 3316 deletions
-44
View File
@@ -219,50 +219,6 @@ var bbw = new Bbw(source, period: 20, multiplier: 2.0);
// BBW updates automatically when prices are added to source
```
## C# Implementation Considerations
### Delegation to SMA and StdDev
BBW composes two internal indicators:
```csharp
private readonly Sma _sma;
private readonly Stddev _stddev;
private readonly double _mult;
```
This reuses existing SMA and StdDev implementations with their warmup and state management.
### Core Calculation
```csharp
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public TValue Update(TValue input, bool isNew = true)
{
_sma.Update(input, isNew);
_stddev.Update(input, isNew);
double smaValue = _sma.Last.Value;
double stdValue = _stddev.Last.Value;
// Guard against division by zero
double bbw = smaValue > 0 ? (2.0 * _mult * stdValue) / smaValue : 0.0;
return new TValue(input.Time, bbw);
}
```
### Memory Layout
| Component | Size | Purpose |
| :-------- | ---: | :------ |
| `_sma` (Sma) | ~48 + N×8 bytes | SMA with circular buffer |
| `_stddev` (Stddev) | ~48 + N×8 bytes | StdDev with circular buffer |
| `_mult` | 8 bytes | Multiplier constant |
| **Total per instance** | **~104 + 2N×8 bytes** | Period-dependent |
For default N=20: approximately 424 bytes per instance.
## References
- Bollinger, J. (2001). *Bollinger on Bollinger Bands*. McGraw-Hill. (Original Bollinger Band methodology)