public MVWAP_V3(IObservable <QTY_PX> source, uint period, IObservable <double> offset) { _source = source; _period = period; _offset = offset; _ring = new RingWnd <double>(period); }
public Variance(IObservable <double> source, uint period, IObservable <double> offset = null) { _source = source; _offset = offset; _period = period; _ring = new RingWnd <double>(period); }
uint _count = 0; // count of elements #region ctor public MaxMin(IObservable <double> source, uint period, Func <double, double, bool> func, IObservable <double> offset = null) { _source = source; _offset = offset; _period = period; _func = func; _ring = new RingWnd <double>(period); }
internal static IObservable <Tuple <TSource, TSource> > RollingWindowX <TSource>(this IObservable <TSource> source, uint period) { RingWnd <TSource> ring = new RingWnd <TSource>(period); return(Observable.Create <Tuple <TSource, TSource> >(obs => { return source.Subscribe(newVal => { obs.OnNext(new Tuple <TSource, TSource>(newVal, ring.Enqueue(newVal))); }, obs.OnError, obs.OnCompleted); })); }
public LWMA_V2(IObservable <double> source, uint period, IObservable <double> offset) { _source = source; _offset = offset; _period = period; for (uint i = 1; i <= period; ++i) { m_weight += i; } _ring = new RingWnd <double>(period); }