mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-20 03:28:05 +00:00
Enhance documentation and validation for various indicators
This commit is contained in:
@@ -49,7 +49,7 @@ public class TrimaValidationTests
|
||||
var sResult = quotes2.GetSma(p2).ToList();
|
||||
|
||||
// Compare last 100 records
|
||||
ValidationHelper.VerifyData(qResult, sResult, x => x.Sma);
|
||||
ValidationHelper.VerifyData(qResult, sResult, x => x.Sma, tolerance: ValidationHelper.SkenderTolerance);
|
||||
}
|
||||
_output.WriteLine("TRIMA Batch(TSeries) validated successfully against Skender Composite SMA");
|
||||
}
|
||||
@@ -75,7 +75,7 @@ public class TrimaValidationTests
|
||||
int lookback = TALib.Functions.TrimaLookback(period);
|
||||
|
||||
// Compare last 100 records
|
||||
ValidationHelper.VerifyData(qResult, output, outRange, lookback, tolerance: ValidationHelper.OoplesTolerance);
|
||||
ValidationHelper.VerifyData(qResult, output, outRange, lookback, tolerance: ValidationHelper.TalibTolerance);
|
||||
}
|
||||
_output.WriteLine("TRIMA Batch(TSeries) validated successfully against TA-Lib");
|
||||
}
|
||||
@@ -109,7 +109,7 @@ public class TrimaValidationTests
|
||||
var tResult = outputs[0];
|
||||
|
||||
// Compare last 100 records
|
||||
ValidationHelper.VerifyData(qResult, tResult, lookback, tolerance: ValidationHelper.OoplesTolerance);
|
||||
ValidationHelper.VerifyData(qResult, tResult, lookback, tolerance: ValidationHelper.TulipTolerance);
|
||||
}
|
||||
_output.WriteLine("TRIMA Batch(TSeries) validated successfully against Tulip");
|
||||
}
|
||||
@@ -135,7 +135,7 @@ public class TrimaValidationTests
|
||||
int lookback = TALib.Functions.TrimaLookback(period);
|
||||
|
||||
// Compare last 100 records
|
||||
ValidationHelper.VerifyData(qOutput, talibOutput, outRange, lookback, tolerance: ValidationHelper.OoplesTolerance);
|
||||
ValidationHelper.VerifyData(qOutput, talibOutput, outRange, lookback, tolerance: ValidationHelper.TalibTolerance);
|
||||
}
|
||||
_output.WriteLine("TRIMA Span validated successfully against TA-Lib");
|
||||
}
|
||||
|
||||
@@ -32,9 +32,24 @@ $$ TRIMA = SMA(SMA(Price, P_1), P_2) $$
|
||||
|
||||
## Performance Profile
|
||||
|
||||
| Metric | Score | Notes |
|
||||
| :--- | :--- | :--- |
|
||||
| **Throughput** | 10 | High; O(1) calculation via cascaded SMAs. |
|
||||
| **Allocations** | 0 | Zero-allocation in hot paths. |
|
||||
| **Complexity** | O(1) | Constant time regardless of period. |
|
||||
| **Accuracy** | 10 | Matches TA-Lib exactly. |
|
||||
| **Timeliness** | 2 | Significant lag; double smoothing delays signals. |
|
||||
| **Overshoot** | 0 | Never overshoots the input data range. |
|
||||
| **Smoothness** | 9 | Very smooth; triangular weighting suppresses noise. |
|
||||
|
||||
## Validation
|
||||
|
||||
Validated against TA-Lib (`TA_TRIMA`) and Skender.Stock.Indicators.
|
||||
| Library | Status | Notes |
|
||||
| :--- | :--- | :--- |
|
||||
| **TA-Lib** | ✅ | Matches `TA_TRIMA` exactly. |
|
||||
| **Skender** | ✅ | Matches composite `SMA(SMA)` logic. |
|
||||
| **Tulip** | ✅ | Matches `trima` exactly. |
|
||||
| **Ooples** | N/A | Not implemented. |
|
||||
|
||||
### Common Pitfalls
|
||||
|
||||
|
||||
Reference in New Issue
Block a user