From 0f2cc39bacb0a6cb3d5d59d3188e748d97e84e8c Mon Sep 17 00:00:00 2001 From: Alexandre Catarino Date: Thu, 15 Feb 2024 14:23:24 +0000 Subject: [PATCH] Fixes Code Snippets --- .../07 Futures/02 Handling Data/09 Symbol Changes.php | 6 +++--- .../12 Universes/06 Futures/12 Continous Contracts.php | 6 +++--- .../02 US Equity Options/06 Supported Assets.html | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/03 Writing Algorithms/03 Securities/99 Asset Classes/07 Futures/02 Handling Data/09 Symbol Changes.php b/03 Writing Algorithms/03 Securities/99 Asset Classes/07 Futures/02 Handling Data/09 Symbol Changes.php index 15897bb5bc..b2c9f03935 100644 --- a/03 Writing Algorithms/03 Securities/99 Asset Classes/07 Futures/02 Handling Data/09 Symbol Changes.php +++ b/03 Writing Algorithms/03 Securities/99 Asset Classes/07 Futures/02 Handling Data/09 Symbol Changes.php @@ -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); @@ -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 diff --git a/03 Writing Algorithms/12 Universes/06 Futures/12 Continous Contracts.php b/03 Writing Algorithms/12 Universes/06 Futures/12 Continous Contracts.php index 82ff8c4270..c12d0dd352 100644 --- a/03 Writing Algorithms/12 Universes/06 Futures/12 Continous Contracts.php +++ b/03 Writing Algorithms/12 Universes/06 Futures/12 Continous Contracts.php @@ -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); @@ -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 diff --git a/03 Writing Algorithms/14 Datasets/03 AlgoSeek/02 US Equity Options/06 Supported Assets.html b/03 Writing Algorithms/14 Datasets/03 AlgoSeek/02 US Equity Options/06 Supported Assets.html index 7f478931d5..4ff89ea28d 100644 --- a/03 Writing Algorithms/14 Datasets/03 AlgoSeek/02 US Equity Options/06 Supported Assets.html +++ b/03 Writing Algorithms/14 Datasets/03 AlgoSeek/02 US Equity Options/06 Supported Assets.html @@ -1 +1 @@ -

To view the supported assets in the US Equity Options dataset, see the Data Explorer.

\ No newline at end of file +

To view the supported assets in the US Equity Options dataset, see the Data Explorer.

\ No newline at end of file