public void AssetPairIsReversedTest()
        {
            var reversed = assetPair.Invert();

            Assert.True(assetPair.IsInverted(reversed));
            Assert.True(reversed.IsInverted(assetPair));
        }
Exemplo n.º 2
0
        public void AssetPairIsInvertedTest()
        {
            var inverted = _btcusd.Invert();

            Assert.True(_btcusd.IsInverted(inverted));
            Assert.True(inverted.IsInverted(_btcusd));
        }
Exemplo n.º 3
0
        public double GetRate(string neededAssetId, AssetPair assetPair, double price)
        {
            var inverted = assetPair.IsInverted(neededAssetId);
            int accuracy = inverted ? assetPair.Accuracy : assetPair.InvertedAccuracy;
            var rate     = inverted ? price : 1 / price;

            return(rate.TruncateDecimalPlaces(accuracy));
        }