예제 #1
0
        public void MinOrderValueCutOffStrategy_AsExpected()
        {
            var toBuyAmount = 2070.2175m;

            var(currentWeights, targetWeights, portfolioValue) = TestResources.ReadWeights();

            var strategy = new MinOrderValueCutOffStrategy(new FollowTargetAdjustmentStrategy(), MIN_ORDER_VALUE / toBuyAmount);

            var adjustedWeights =
                strategy.AdjustWeights(currentWeights, targetWeights, portfolioValue / toBuyAmount);

            Assert.IsTrue(adjustedWeights.Sum(w => w.Value).IsApproxOne());
        }
예제 #2
0
        public void FollowTargetAdjustmentStrategy_AsExpected()
        {
            var toBuyAmount = 2000m;

            var(currentWeights, targetWeights, portfolioValue) = TestResources.ReadWeights();

            var strategy = new FollowTargetAdjustmentStrategy();

            var adjustedWeights =
                strategy.AdjustWeights(currentWeights, targetWeights, portfolioValue / toBuyAmount);

            Assert.IsTrue(adjustedWeights.Sum(w => w.Value).IsApproxOne());
        }