Skip to content

Commit

Permalink
Fixes Code Snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexCatarino committed Feb 15, 2024
1 parent 9583ff8 commit 0f2cc39
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
{
var oldSymbol = changedEvent.OldSymbol;
var newSymbol = changedEvent.NewSymbol;
var tag = $"Rollover - Symbol changed at {_algorithm.Time}: {oldSymbol} -> {newSymbol}";
var quantity = _algorithm.Portfolio[oldSymbol].Quantity;
var tag = $"Rollover - Symbol changed at {Time}: {oldSymbol} -> {newSymbol}";
var quantity = Portfolio[oldSymbol].Quantity;
// Rolling over: to liquidate any position of the old mapped contract and switch to the newly mapped contract
Liquidate(oldSymbol, tag: tag);
if (quantity != 0) MarketOrder(newSymbol, quantity, tag: tag);
Expand All @@ -23,7 +23,7 @@
for symbol, changed_event in slice.SymbolChangedEvents.items():
old_symbol = changed_event.OldSymbol
new_symbol = changed_event.NewSymbol
tag = f"Rollover - Symbol changed at {self._algorithm.Time}: {old_symbol} -> {new_symbol}"
tag = f"Rollover - Symbol changed at {self.Time}: {old_symbol} -> {new_symbol}"
quantity = self.Portfolio[old_symbol].Quantity
# Rolling over: to liquidate any position of the old mapped contract and switch to the newly mapped contract
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
{
var oldSymbol = changedEvent.OldSymbol;
var newSymbol = changedEvent.NewSymbol;
var tag = $"Rollover - Symbol changed at {_algorithm.Time}: {oldSymbol} -> {newSymbol}";
var quantity = _algorithm.Portfolio[oldSymbol].Quantity;
var tag = $"Rollover - Symbol changed at {Time}: {oldSymbol} -> {newSymbol}";
var quantity = Portfolio[oldSymbol].Quantity;
// Rolling over: to liquidate any position of the old mapped contract and switch to the newly mapped contract
Liquidate(oldSymbol, tag: tag);
if (quantity != 0) MarketOrder(newSymbol, quantity, tag: tag);
Expand All @@ -35,7 +35,7 @@
for symbol, changed_event in slice.SymbolChangedEvents.items():
old_symbol = changed_event.OldSymbol
new_symbol = changed_event.NewSymbol
tag = f"Rollover - Symbol changed at {self._algorithm.Time}: {old_symbol} -> {new_symbol}"
tag = f"Rollover - Symbol changed at {self.Time}: {old_symbol} -> {new_symbol}"
quantity = self.Portfolio[old_symbol].Quantity
# Rolling over: to liquidate any position of the old mapped contract and switch to the newly mapped contract
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<p>To view the supported assets in the US Equity Options dataset, see the <a href="/datasets/algoseek-us-equities/explorer">Data Explorer</a>.</p>
<p>To view the supported assets in the US Equity Options dataset, see the <a href="/datasets/algoseek-us-equity-options/explorer">Data Explorer</a>.</p>

0 comments on commit 0f2cc39

Please sign in to comment.