Beispiel #1
0
        public void Should_return_695dot26_value_of_tranaction_when_give_index_de30()
        {
            var symbol       = "DE30";
            var categoryName = CategoryName.Index;
            var contractSize = 25;
            var bidPrice     = 12265.3;
            var askPrice     = 12267.8;
            var currency     = "EUR";
            var laverage     = 5;
            var precision    = 1;
            var spread       = 1;

            var valuation  = new Valuation(bidPrice, askPrice);
            var instrument = new Instrument(symbol, categoryName, currency, valuation, new TimeSpan(02, 00, 00));

            instrument.SetContractSize(contractSize);
            instrument.SetLeverage(laverage);
            instrument.SetPrecision(precision);
            instrument.SetSpread(spread);

            var valueTransaction = instrument.ComputeValueTransaction(0.01M, instrument.Valuation.BidPrice);

            Assert.Equal(659.26M, valueTransaction);
        }