Skip to content

Commit

Permalink
Update 02 Encoding Symbols.html
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekMelchin authored Jun 7, 2024
1 parent 9ef5bd4 commit a1addf4
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,22 @@

<img class="img-responsive" src="https://cdn.quantconnect.com/docs/i/symbol-encoding-examples_rev0.png" style="max-width: 400px" alt="Security identifier decomposition">

<p>LEAN assumes the ticker you pass to the <a href="/docs/v2/writing-algorithms/securities/asset-classes/us-equity/requesting-data#02-Create-Subscriptions"><span class="csharp">AddEquity</span><span class="python">add_equity</span></a> method is the current ticker of the Equity asset. To access this ticker, use the <code class="csharp">Value</code><code class="python">value</code> property of the <code>Symbol</code> object.</p>
<p>
LEAN assumes the ticker you pass to the <a href="/docs/v2/writing-algorithms/securities/asset-classes/us-equity/requesting-data#02-Create-Subscriptions"><span class="csharp">AddEquity</span><span class="python">add_equity</span></a> method is the current ticker of the Equity asset.
To access this ticker, use the <code class="csharp">Value</code><code class="python">value</code> property of the <code>Symbol</code> object.
</p>

<div class="section-example-container">
<pre class="python">self._symbol = self.add_equity("GOOG").symbol
self.debug(self._symbol.id.value) # Prints "GOOCV"
self.debug(self._symbol.value) # Prints "GOOG"
self.debug(str(self._symbol.id)) # Prints "GOOCV VP83T1ZUHROL"
</pre>
<pre class="csharp">var symbol = AddEquity("GOOG").Symbol;
Debug(symbol.ID.Value); // Prints "GOOCV"
Debug(symbol.Value); // Prints "GOOG"
Debug(symbol.ID.Value); // Prints "GOOCV"
Debug(symbol.Value); // Prints "GOOG"
Debug(symbol.ID.ToString()); // Prints "GOOCV VP83T1ZUHROL"
</pre>
</div>

<p>If you create the security subscription with a <a href="/docs/v2/writing-algorithms/universes/equity">universe selection</a> function, the <code class="csharp">Value</code><code class="python">value</code> property of the <code>Symbol</code> object is the point-in-time ticker.</p>
<p>If you create the security subscription with a <a href="/docs/v2/writing-algorithms/universes/equity">universe selection</a> function, the <code class="csharp">Value</code><code class="python">value</code> property of the <code>Symbol</code> object is the point-in-time ticker.</p>

0 comments on commit a1addf4

Please sign in to comment.