コード例 #1
0
        public void Calculate_CorrectInput__CalculatesCorrectly(float[] highs, float[] lows, int period, float[] expectedH, float[] expectedL)
        {
            HLChannelData res = HLChannel.Calculate(highs, lows, period);

            res.H.ShouldBe(expectedH);
            res.L.ShouldBe(expectedL);
        }
コード例 #2
0
        private void TestForEmptyList(float[] highs, float[] lows, int period)
        {
            HLChannelData res = HLChannel.Calculate(highs, lows, period);

            res.H.Length.ShouldBe(0);
            res.L.Length.ShouldBe(0);
        }
コード例 #3
0
        public override void Calculate(StockPricesData data)
        {
            HLChannelData res = HLChannel.Calculate(data.H, data.L, _statParams.Get(StatHLChannelParams.Period).As <int>());

            _data[StatHLChannelData.H] = res.H;
            _data[StatHLChannelData.L] = res.L;
        }