Reply To: Numerical accuracy of script computation

Optuma Forums Optuma Scripting Numerical accuracy of script computation Reply To: Numerical accuracy of script computation

  • Topics: 16
  • Replies: 907
  • Posts: 923

Hi Colin,

Thanks for your post. What has happened is that the low of the day was actually recorded as 25.485. We can see that by pushing the decimal places (by right clicking on the price scale) to 3 decimal places. I added a Bar Label in this image to show it.


When we display the chart, the prices are rounded to 2 decimal places (I did not think a half cent trade was possible on a $25 stock, but it may be some dividend etc). Point is that the rounding pushes the low up to 25.49 but it also pushes the range up to 0.52.

Once you put in the adjustment into your excel for the low, you will see that the error disappears. There is still a small rounding issue in the final computation, but at $0.0005, slippage will be more of a problem when executing.


Hope that helps


Pin It on Pinterest

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.