<?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[datatype for weights seems changed recently]]></title><description><![CDATA[<pre><code>weights = qnbt.backtest(
    competition_type="stocks_s&amp;p500",
    load_data=load_data,
    lookback_period=350,
    start_date="2006-01-01",
    strategy=strategy,
    window=window,
    analyze=True,
    check_correlation=False
)

</code></pre>
<p dir="auto">In the old days, i can write using  as below as per documentation</p>
<pre><code>qnout.write(weights)
</code></pre>
<p dir="auto">Since some days ago, the above doesn't work, i need to change to</p>
<pre><code>qnout.write(weights[0])
</code></pre>
<p dir="auto">to make it work again, does it expect? <a class="plugin-mentions-user plugin-mentions-a" href="http://quantiacs.com/community/uid/12">@support</a></p>
]]></description><link>http://quantiacs.com/community/topic/633/datatype-for-weights-seems-changed-recently</link><generator>RSS for Node</generator><lastBuildDate>Mon, 07 Sep 2026 18:32:13 GMT</lastBuildDate><atom:link href="http://quantiacs.com/community/topic/633.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 01 Jan 2025 08:26:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to datatype for weights seems changed recently on Fri, 03 Jan 2025 18:13:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://quantiacs.com/community/uid/229">@stefanm</a> Thank you for the details</p>
]]></description><link>http://quantiacs.com/community/post/1842</link><guid isPermaLink="true">http://quantiacs.com/community/post/1842</guid><dc:creator><![CDATA[angusslq]]></dc:creator><pubDate>Fri, 03 Jan 2025 18:13:52 GMT</pubDate></item><item><title><![CDATA[Reply to datatype for weights seems changed recently on Fri, 03 Jan 2025 11:01:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://quantiacs.com/community/uid/3746">@angusslq</a> Hi,</p>
<p dir="auto">The <code>qnbt.backtest</code> function you used can return only weights (as xarray.DataArray structure), or <strong>tuple</strong> (weights, state). It depends on your <code>strategy()</code> function, whether it has additional arguments (beside "data") or not. The "state" doesn't affect your weights if it hasn't been used in the strategy you passed, and in this case, the state is most likely <code>None</code>.</p>
<p dir="auto">Anyway, it's not necessary to call <code>write()</code> function from <code>qnt.output</code> module after calculating weights using <code>qnt.backtester</code>, since the <code>backtest()</code> function already calls <code>write()</code> function, so the weights have been written automatically.</p>
]]></description><link>http://quantiacs.com/community/post/1841</link><guid isPermaLink="true">http://quantiacs.com/community/post/1841</guid><dc:creator><![CDATA[stefanm]]></dc:creator><pubDate>Fri, 03 Jan 2025 11:01:04 GMT</pubDate></item></channel></rss>