Skip to content

Commit 5c62abb

Browse files
authored
Fix: use DateTime.UtcNow instead of algorithm time in MapSymbol (#207)
* fix: use DateTime.UtcNow instead of algorithm time in MapSymbol * feat: use Algorithm.GetLocked
1 parent dd8f4fe commit 5c62abb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

QuantConnect.InteractiveBrokersBrokerage/InteractiveBrokersBrokerage.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3862,7 +3862,8 @@ private Symbol MapSymbol(Contract contract)
38623862
// As such, we resolve the underlying future to the future with the correct contract month.
38633863
// There's a chance this can fail, and if it does, we throw because this Symbol can't be
38643864
// represented accurately in Lean.
3865-
var futureSymbol = FuturesOptionsUnderlyingMapper.GetUnderlyingFutureFromFutureOption(leanSymbol, market, contractExpiryDate, _algorithm.Time);
3865+
var futureSymbol = FuturesOptionsUnderlyingMapper.GetUnderlyingFutureFromFutureOption(leanSymbol, market, contractExpiryDate,
3866+
_algorithm?.GetLocked() == true ? _algorithm.Time : DateTime.UtcNow);
38663867
if (futureSymbol == null)
38673868
{
38683869
// This is the worst case scenario, because we didn't find a matching futures contract for the FOP.

0 commit comments

Comments
 (0)