Пример #1
0
        public void Ctor_ValidWeight_WeigthPropertyIsSet( [Values( 0.1, 0.5, 1 )] double weight )
        {
            var innerIndicator = Mockery.NewMock<IIndicator>();

            var indicator = new WeightedIndicator( innerIndicator, weight );

            Assert.That( indicator.Weight, Is.EqualTo( weight ) );
        }
Пример #2
0
            public WeightedIndicatorResult( WeightedIndicator indicator, IndicatorResult result )
                : base(indicator.Name, result.Stock)
            {
                Signal = result.Signal.Weight( indicator.Weight );

                ExpectedGain = result.ExpectedGain * indicator.Weight;
                GainRiskRatio = result.GainRiskRatio * indicator.Weight;

                Report = result.Report;

                Signals = result.Signals.Derive( new ObjectDescriptor( "Weighted" ), s => s.Weight( indicator.Weight ) );
            }
Пример #3
0
            public WeightedIndicatorResult(WeightedIndicator indicator, IndicatorResult result)
                : base(indicator.Name, result.Stock)
            {
                Signal = result.Signal.Weight(indicator.Weight);

                ExpectedGain  = result.ExpectedGain * indicator.Weight;
                GainRiskRatio = result.GainRiskRatio * indicator.Weight;

                Report = result.Report;

                Signals = result.Signals.Derive(new ObjectDescriptor("Weighted"), s => s.Weight(indicator.Weight));
            }