From 3d2118f483c3ee30842a1dfb6e3317fd8378bcd6 Mon Sep 17 00:00:00 2001 From: Alexandre Catarino Date: Thu, 25 Apr 2024 13:47:15 +0100 Subject: [PATCH] Adds Mapping to ETH Futures (#107) * Adds Mapping to ETH Futures CME ETH is represented by ETHUSDRR: https://www.interactivebrokers.com/en/trading/margin-futures-fops.php * 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. --- .../InteractiveBrokers/IB-symbol-map.json | 1 + .../InteractiveBrokersBrokerage.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/QuantConnect.InteractiveBrokersBrokerage/InteractiveBrokers/IB-symbol-map.json b/QuantConnect.InteractiveBrokersBrokerage/InteractiveBrokers/IB-symbol-map.json index f8b56a3..dfe2fef 100644 --- a/QuantConnect.InteractiveBrokersBrokerage/InteractiveBrokers/IB-symbol-map.json +++ b/QuantConnect.InteractiveBrokersBrokerage/InteractiveBrokers/IB-symbol-map.json @@ -16,6 +16,7 @@ "RUR": "6R", "ZAR": "6Z", "BRR": "BTC", + "ETHUSDRR": "ETH", "DA": "DC", "BQX": "BIO" } 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();