Skip to content

Commit

Permalink
Adds Setting Time Zone
Browse files Browse the repository at this point in the history
- The data of some securities is UTC so history requests fail
to get the latest prices.
- Use `load-csharp-assemblies.php` for all types.
  • Loading branch information
AlexCatarino committed Aug 9, 2023
1 parent 30297c4 commit 4086b0c
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

<ol>
<?
$additionalImports = "using QuantConnect.Data;
using QuantConnect.Securities;
using QuantConnect.Securities.Option;
$additionalImports = "using QuantConnect.Securities.Option;
";
include(DOCS_RESOURCES."/datasets/research-environment/load-csharp-assemblies.php");
?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@

<ol>
<?
$additionalImports = "";
$additionalImports = "using QuantConnect.Securities.Crypto;
";
include(DOCS_RESOURCES."/datasets/research-environment/load-csharp-assemblies.php");
?>
<li>Create a <code>QuantBook</code>.</li>
<div class="section-example-container">
<pre class="csharp">var qb = new QuantBook();</pre>
<pre class="python">qb = QuantBook()</pre>
</div>
<li><i>(Optional)</i> Set the time zone to the data time zone.</li>
<div class="section-example-container">
<pre class="csharp">qb.SetTimeZone(TimeZones.Utc);</pre>
<pre class="python">qb.SetTimeZone(TimeZones.Utc)</pre>
</div>
<li>Call the <code>AddCrypto</code> method with a ticker and then save a reference to the Crypto <code>Symbol</code>.</li>
<div class="section-example-container">
<pre class="csharp">var btcusd = qb.AddCrypto("BTCUSD").Symbol;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@

<ol>
<?
$additionalImports = "";
$additionalImports = "using QuantConnect.Securities.CryptoFuture;
";
include(DOCS_RESOURCES."/datasets/research-environment/load-csharp-assemblies.php");
?>
<li>Create a <code>QuantBook</code>.</li>
<div class="section-example-container">
<pre class="csharp">var qb = new QuantBook();</pre>
<pre class="python">qb = QuantBook()</pre>
</div>
<div class="section-example-container">
<pre class="csharp">qb.SetTimeZone(TimeZones.Utc);</pre>
<pre class="python">qb.SetTimeZone(TimeZones.Utc)</pre>
</div>
<li>Call the <code>AddCryptoFuture</code> method with a ticker and then save a reference to the Crypto Future <code>Symbol</code>.</li>
<div class="section-example-container">
<pre class="csharp">var btcusd = qb.AddCryptoFuture("BTCUSD").Symbol;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

<ol>
<?
$additionalImports = "using QuantConnect.Data;
using QuantConnect.Securities;
using QuantConnect.Securities.Future;
$additionalImports = "using QuantConnect.Securities.Future;
";
include(DOCS_RESOURCES."/datasets/research-environment/load-csharp-assemblies.php");
?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

<ol>
<?
$additionalImports = "using QuantConnect.Data;
using QuantConnect.Securities;
using QuantConnect.Securities.Future;
$additionalImports = "using QuantConnect.Securities.Future;
using QuantConnect.Securities.FutureOption;
";
include(DOCS_RESOURCES."/datasets/research-environment/load-csharp-assemblies.php");
?>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
<p>Follow these steps to subscribe to a Forex security:</p>

<ol>
<li class="csharp">Load the required assembly files and data types.</li>
<div class="csharp section-example-container">
<pre class="csharp">#load "../Initialize.csx"
#load "../QuantConnect.csx"
#r "../Microsoft.Data.Analysis.dll"

using QuantConnect;
using QuantConnect.Data;
using QuantConnect.Algorithm;
using QuantConnect.Research;
using Microsoft.Data.Analysis;</pre>
</div>
<?
$additionalImports = "using QuantConnect.Securities.Forex;
";
include(DOCS_RESOURCES."/datasets/research-environment/load-csharp-assemblies.php");
?>
<li>Create a <code>QuantBook</code>.</li>
<div class="section-example-container">
<pre class="csharp">var qb = new QuantBook();</pre>
<pre class="python">qb = QuantBook()</pre>
</div>
<li><i>(Optional)</i> Set the time zone to the data time zone.</li>
<div class="section-example-container">
<pre class="csharp">qb.SetTimeZone(TimeZones.Utc);</pre>
<pre class="python">qb.SetTimeZone(TimeZones.Utc)</pre>
</div>
<li>Call the <code>AddForex</code> method with a ticker and then save a reference to the Forex <code>Symbol</code>.</li>
<div class="section-example-container">
<pre class="csharp">var eurusd = qb.AddForex("EURUSD").Symbol;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
<p>Follow these steps to subscribe to a CFD security:</p>

<ol>
<li class="csharp">Load the required assembly files and data types.</li>
<div class="csharp section-example-container">
<pre class="csharp">#load "../Initialize.csx"
#load "../QuantConnect.csx"
#r "../Microsoft.Data.Analysis.dll"

using QuantConnect;
using QuantConnect.Data;
using QuantConnect.Algorithm;
using QuantConnect.Research;
using Microsoft.Data.Analysis;</pre>
</div>
<?
$additionalImports = "using QuantConnect.Securities.Cfd;
";
include(DOCS_RESOURCES."/datasets/research-environment/load-csharp-assemblies.php");
?>
<li>Create a <code>QuantBook</code>.</li>
<div class="section-example-container">
<pre class="csharp">var qb = new QuantBook();</pre>
<pre class="python">qb = QuantBook()</pre>
</div>
<li><i>(Optional)</i> Set the time zone to the data time zone.</li>
<div class="section-example-container">
<pre class="csharp">qb.SetTimeZone(TimeZones.Utc);</pre>
<pre class="python">qb.SetTimeZone(TimeZones.Utc)</pre>
</div>
<li>Call the <code>AddCfd</code> method with a ticker and then save a reference to the CFD <code>Symbol</code>.</li>
<div class="section-example-container">
<pre class="csharp">var spx = qb.AddCfd("SPX500USD").Symbol;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
<p>Follow these steps to subscribe to an Index security:</p>

<ol>
<li class="csharp">Load the required assembly files and data types.</li>
<div class="csharp section-example-container">
<pre class="csharp">#load "../Initialize.csx"
#load "../QuantConnect.csx"
#r "../Microsoft.Data.Analysis.dll"

using QuantConnect;
using QuantConnect.Data;
using QuantConnect.Algorithm;
using QuantConnect.Research;
using Microsoft.Data.Analysis;</pre>
</div>
<?
$additionalImports = "using QuantConnect.Securities.Index;
";
include(DOCS_RESOURCES."/datasets/research-environment/load-csharp-assemblies.php");
?>
<li>Create a <code>QuantBook</code>.</li>
<div class="section-example-container">
<pre class="csharp">var qb = new QuantBook();</pre>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
<p>Follow these steps to subscribe to an Index Option security:</p>

<ol>
<li class="csharp">Load the required assembly files and data types.</li>
<div class="csharp section-example-container">
<pre class="csharp">#load "../Initialize.csx"
#load "../QuantConnect.csx"
#r "../Microsoft.Data.Analysis.dll"

using QuantConnect;
using QuantConnect.Data;
using QuantConnect.Data.Market;
using QuantConnect.Algorithm;
using QuantConnect.Securities;
using QuantConnect.Securities.Index;
using QuantConnect.Securities.Option;
using QuantConnect.Research;
using Microsoft.Data.Analysis;</pre>
</div>
<?
$additionalImports = "using QuantConnect.Securities.Index;
using QuantConnect.Securities.IndexOption;
";
include(DOCS_RESOURCES."/datasets/research-environment/load-csharp-assemblies.php");
?>
<li>Instantiate a <code>QuantBook</code>.</li>
<div class="section-example-container">
<pre class="csharp">var qb = new QuantBook();</pre>
Expand Down

0 comments on commit 4086b0c

Please sign in to comment.