擅长:python、mysql、java
<h2>我怎样才能防止。。。?在</h2>
<p>好吧,一旦需要比简单的<strong><code>numpy</code></strong>向量化/广播/条件操作更复杂的东西时,我们必须实现一些定制的特定功能,以处理这些附加功能,其中有限状态自动机可以很好地满足这些目的。在</p>
<hr/>
<h2>但如何实施呢?在</h2>
<p>简单地说,您的条件已经超出了简单的矢量化/广播矩阵操作的表达能力,交易管理子系统已经开始有一个内部的、一个顺序的行为和一些附加的规则,用于它的内部转换和转换限制。在</p>
<p>人们很难期望通用的工具,<strong><code>numpy</code></strong>-矩阵和<strong><code>pandas</code></strong>-数据帧实例被过度设计,以支持此类特定于问题领域的功能,从而原型化算法交易策略模拟。在</p>
<p>最好选择一些特定于交易的工具来满足这种需求,或者期望必须实现一个SEQ behavior迭代器函数,这将有助于实现所需的逻辑(智能numpy向量化/广播表达式或pandas one liner将不再满足这里的要求)。在</p>
<blockquote>
<p><strong>Scope?</strong><br/>for those really interested in a rapid prototyped Trading Strategy example, using a FSA-based implementation method, check the simplicity of such system design + built-in ( script-based ) automated conformance-testing capability + line numbers for an estimate of the code-span ( definitely not a <code>numpy</code> SLOC ):
<a href="https://i.stack.imgur.com/Zze7d.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Zze7d.png" alt="enter image description here"/></a></p>
</blockquote>