mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-22 04:28:04 +00:00
OBV, TRIMA
This commit is contained in:
@@ -22,7 +22,10 @@ public class MAX_Series : Single_TSeries_Indicator
|
||||
|
||||
double _max = TValue.v;
|
||||
for (int i = 0; i < this._buffer.Count; i++)
|
||||
{ _max = (this._buffer[i] > _max) ? this._buffer[i] : _max; }
|
||||
{
|
||||
//_max = (this._buffer[i] > _max) ? this._buffer[i] : _max;
|
||||
_max = Math.Max(this._buffer[i], _max);
|
||||
}
|
||||
|
||||
var result = (TValue.t, this.Count < this._p - 1 && this._NaN ? double.NaN : _max);
|
||||
|
||||
|
||||
@@ -22,7 +22,10 @@ public class MIN_Series : Single_TSeries_Indicator
|
||||
|
||||
double _min = TValue.v;
|
||||
for (int i = 0; i < this._buffer.Count; i++)
|
||||
{ _min = (this._buffer[i] < _min) ? this._buffer[i] : _min; }
|
||||
{
|
||||
//_min = (this._buffer[i] < _min) ? this._buffer[i] : _min;
|
||||
_min = Math.Min(this._buffer[i], _min);
|
||||
}
|
||||
|
||||
var result = (TValue.t, (this.Count < this._p - 1 && this._NaN) ? double.NaN : _min);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user