Skip to content

Commit

Permalink
Update 99 Examples.html
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekMelchin authored Oct 28, 2024
1 parent 830beb6 commit 524bacb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ <h4>Example 2: 10 Stocks Above Their 200-Day EMA With >$1B of Daily Trading Volu
<pre class="python">class UpTrendLiquidUniverseAlgorithm(QCAlgorithm):

# Create a dictionary to store the EMA data for universe selection.
_selection_data_by_symbol = { }
_selection_data_by_symbol = {}

def initialize(self) -> None:
# Add the custom universe.
Expand All @@ -102,7 +102,7 @@ <h4>Example 2: 10 Stocks Above Their 200-Day EMA With >$1B of Daily Trading Volu
def _select_assets(self, fundamental: List[Fundamental]) -> List[Symbol]:
for f in fundamental:
# Create/Update the EMA indicators of each stock.
if f.symbol not in self._state_data:
if f.symbol not in self._selection_data_by_symbol:
self._selection_data_by_symbol[f.symbol] = SelectionData(f.symbol, 200)
self._selection_data_by_symbol[f.symbol].update(f.end_time, f.adjusted_price, f.dollar_volume)

Expand Down

0 comments on commit 524bacb

Please sign in to comment.