예제 #1
0
 public MVWAP_V3(IObservable <QTY_PX> source, uint period, IObservable <double> offset)
 {
     _source = source;
     _period = period;
     _offset = offset;
     _ring   = new RingWnd <double>(period);
 }
예제 #2
0
파일: StdDev.cs 프로젝트: lulzzz/Quant
        public Variance(IObservable <double> source, uint period, IObservable <double> offset = null)
        {
            _source = source;
            _offset = offset;
            _period = period;

            _ring = new RingWnd <double>(period);
        }
예제 #3
0
파일: MaxMin.cs 프로젝트: lulzzz/Quant
        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);
        }
예제 #4
0
        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);
            }));
        }
예제 #5
0
파일: LWMA_V2.cs 프로젝트: lulzzz/Quant
        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);
        }