Skip to content

Commit

Permalink
Adds Mapping to ETH Futures (#107)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
AlexCatarino authored Apr 25, 2024
1 parent 8a48a29 commit 3d2118f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"RUR": "6R",
"ZAR": "6Z",
"BRR": "BTC",
"ETHUSDRR": "ETH",
"DA": "DC",
"BQX": "BIO"
}
Original file line number Diff line number Diff line change
Expand Up @@ -4119,7 +4119,7 @@ public IEnumerable<Symbol> 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();
Expand Down

0 comments on commit 3d2118f

Please sign in to comment.