public IPrice Create(PriceDto priceDto, ICurrencyPair currencyPair)
        {
            var bid = new ExecutablePrice(Direction.SELL, priceDto.Bid, _executionRepository);
            var ask = new ExecutablePrice(Direction.BUY, priceDto.Ask, _executionRepository);
            var price = new Price(bid, ask, priceDto.SpotDate, currencyPair, priceDto.CreationTimestamp);

            _priceLatencyRecorder.OnReceived(price);

            return price;
        }
        public IPrice Create(PriceDto priceDto, ICurrencyPair currencyPair)
        {
            var bid   = new ExecutablePrice(Direction.SELL, priceDto.Bid, _executionRepository);
            var ask   = new ExecutablePrice(Direction.BUY, priceDto.Ask, _executionRepository);
            var price = new Price(bid, ask, priceDto.SpotDate, currencyPair, priceDto.CreationTimestamp);

            _priceLatencyRecorder.OnReceived(price);

            return(price);
        }
Beispiel #3
0
        public Price(ExecutablePrice bid, ExecutablePrice ask, DateTime valueDate, ICurrencyPair currencyPair, long serverTimestamp)
        {
            _serverTimestamp = serverTimestamp;
            Bid          = bid;
            Ask          = ask;
            ValueDate    = valueDate;
            CurrencyPair = currencyPair;

            bid.Parent = this;
            ask.Parent = this;

            Spread = (ask.Rate - bid.Rate) * (long)Math.Pow(10, currencyPair.PipsPosition);
        }
Beispiel #4
0
        public Price(ExecutablePrice bid, ExecutablePrice ask, DateTime valueDate, ICurrencyPair currencyPair, long serverTimestamp)
        {
            _serverTimestamp = serverTimestamp;
            Bid = bid;
            Ask = ask;
            ValueDate = valueDate;
            CurrencyPair = currencyPair;

            bid.Parent = this;
            ask.Parent = this;

            Spread = (ask.Rate - bid.Rate)* (long)Math.Pow(10, currencyPair.PipsPosition);
        }