title: Can't convert the math equation to python code - Polychrom Momentum technical-indicator
body: <p>I am having trouble calculating a technical indicator.</p>
  <p>Below is the paper which explains the math equation for the technical indicator.
  <a href="https://i.stack.imgur.com/KKhQp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KKhQp.png" alt="enter image description here" /></a>
  Here is my code which doesn't work as planned.</p>
  <pre><code>def poly_mtm(length: int, prices: list[float]) -&gt; float:
      poly = 0.0
      for i in range(1, length + 1):
          price = prices[-1]
          price_i = prices[-i]
          mtm_i = price - price_i
          poly += mtm_i / math.sqrt(i)
      return poly
  </code></pre>
  <p>My data is a list of floats(stock prices).
  The expected results should be between -18 to 18.
  my actual results vary between -100 to 100</p>
  <p>Any suggestions would be welcome.</p>