Exemple #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 ) );
        }
Exemple #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 ) );
            }
Exemple #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));
            }