<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Accessing both market and index data in strategy()]]></title><description><![CDATA[<p dir="auto">Hi, I'd like to access to access both market and index data in strategy(). Would the following code work? It worked locally but when submitted the "checking" progress does not move at all.</p>
<pre><code># load data
data = qndata.stocks.load_ndx_data(min_date="2005-01-01")

def strategy(data):
    # get index data
    index_name = 'NDX'
    index_data = qndata.index.load_data(assets=[index_name], min_date='2005-01-01', forward_order=True)
    index_data = xr.align(index_data.sel(asset=index_name), data.isel(field=0), join='right')[0]
    ndx_values = index_data.values
</code></pre>
<p dir="auto">I also tried a <code>load_data</code> function where I load both datasets and use <code>load_data=load_data</code> in <code>qnbt.backtest()</code> , but it quickly leads to a memory leak.</p>
]]></description><link>http://quantiacs.com/community/topic/586/accessing-both-market-and-index-data-in-strategy</link><generator>RSS for Node</generator><lastBuildDate>Sat, 14 Mar 2026 08:09:32 GMT</lastBuildDate><atom:link href="http://quantiacs.com/community/topic/586.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 12 May 2024 16:12:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Accessing both market and index data in strategy() on Fri, 31 May 2024 08:33:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://quantiacs.com/community/uid/2548">@buyers_are_back</a> Hello.<br />
Here is a new example of stock prediction using index data.<br />
I recommend using the single-pass version.<br />
<a href="https://quantiacs.com/documentation/en/data/indexes.html" rel="nofollow ugc">https://quantiacs.com/documentation/en/data/indexes.html</a></p>
]]></description><link>http://quantiacs.com/community/post/1711</link><guid isPermaLink="true">http://quantiacs.com/community/post/1711</guid><dc:creator><![CDATA[Vyacheslav_B]]></dc:creator><pubDate>Fri, 31 May 2024 08:33:27 GMT</pubDate></item><item><title><![CDATA[Reply to Accessing both market and index data in strategy() on Tue, 14 May 2024 13:05:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://quantiacs.com/community/uid/5">@vyacheslav_b</a> Thank you! I'll have a look</p>
]]></description><link>http://quantiacs.com/community/post/1673</link><guid isPermaLink="true">http://quantiacs.com/community/post/1673</guid><dc:creator><![CDATA[buyers_are_back]]></dc:creator><pubDate>Tue, 14 May 2024 13:05:39 GMT</pubDate></item><item><title><![CDATA[Reply to Accessing both market and index data in strategy() on Tue, 14 May 2024 08:46:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://quantiacs.com/community/uid/2548">@buyers_are_back</a> Hello.</p>
<p dir="auto">Here is an example: <a href="https://github.com/quantiacs/strategy-predict-NASDAQ100-use-SPX/blob/master/strategy.ipynb" rel="nofollow ugc">example link</a>.</p>
<p dir="auto">You can view the list of available indexes <a href="https://quantiacs.com/documentation/en/data/indexes.html" rel="nofollow ugc">here</a>.</p>
<p dir="auto">If you want to use the <code>load_data</code> function, take a look at this example. You can implement the index download by analogy:</p>
<p dir="auto"><a href="https://quantiacs.com/community/topic/556/is-it-possible-to-combine-stocks-with-crypto/2" rel="nofollow ugc">example link</a>.</p>
]]></description><link>http://quantiacs.com/community/post/1672</link><guid isPermaLink="true">http://quantiacs.com/community/post/1672</guid><dc:creator><![CDATA[Vyacheslav_B]]></dc:creator><pubDate>Tue, 14 May 2024 08:46:08 GMT</pubDate></item></channel></rss>