mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-19 02:58:05 +00:00
volume indicators
This commit is contained in:
@@ -173,6 +173,16 @@ public abstract class BiInputIndicatorBase : AbstractBase
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public TValue Update(TValue actual, TValue predicted, bool isNew = true)
|
||||
{
|
||||
// Save state BEFORE sanitizers mutate it (for bar correction restore)
|
||||
if (isNew)
|
||||
{
|
||||
_p_state = _state;
|
||||
}
|
||||
else
|
||||
{
|
||||
_state = _p_state;
|
||||
}
|
||||
|
||||
double actualVal = SanitizeActual(actual.Value);
|
||||
double predictedVal = SanitizePredicted(predicted.Value);
|
||||
double error = ComputeError(actualVal, predictedVal);
|
||||
|
||||
@@ -288,7 +288,7 @@ public sealed class RingBuffer : IEnumerable<double>
|
||||
/// If wrapped, returns span over a copy.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para><b> Allocation Warning:</b> When the buffer wraps around (i.e., when data spans
|
||||
/// <para><b>Allocation Warning:</b> When the buffer wraps around (i.e., when data spans
|
||||
/// from the end of the internal array back to the beginning), this method allocates a new
|
||||
/// array via <see cref="ToArray"/> to return contiguous data. For allocation-free iteration
|
||||
/// over wrapped buffers, use <see cref="GetSequencedSpans"/> instead.</para>
|
||||
|
||||
Reference in New Issue
Block a user