From 10bb17e9dc6b89a1f7af2a7a4691935f4f620955 Mon Sep 17 00:00:00 2001 From: Alexandre Catarino Date: Wed, 24 Apr 2024 23:40:02 +0100 Subject: [PATCH] Fixes GetContractMultiplier GetContractMultiplier was rounding contract multiplier incorrectly, leading to an unsuccessful contract details request. E.g. LBR multiplier is 27.5 and was converted to "28" instead of "27.5". Instead of rounding all multipliers above 1, we will only round them if the decimal part is zero. --- .../InteractiveBrokersBrokerage.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/QuantConnect.InteractiveBrokersBrokerage/InteractiveBrokersBrokerage.cs b/QuantConnect.InteractiveBrokersBrokerage/InteractiveBrokersBrokerage.cs index deab4c5..03acbef 100644 --- a/QuantConnect.InteractiveBrokersBrokerage/InteractiveBrokersBrokerage.cs +++ b/QuantConnect.InteractiveBrokersBrokerage/InteractiveBrokersBrokerage.cs @@ -4119,7 +4119,7 @@ public IEnumerable LookupSymbols(Symbol symbol, bool includeExpired, str private static string GetContractMultiplier(decimal contractMultiplier) { - if (contractMultiplier >= 1) + if (contractMultiplier % 1 == 0) { // IB doesn't like 5000.0 return Convert.ToInt32(contractMultiplier).ToStringInvariant();