Reply To: Numerical accuracy of script computation

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

#46631
Mathew
Mathew
  • Topics: 15
  • Replies: 823
  • Posts: 838

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.

agl

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.

xl

Hope that helps

Mathew

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.

Close