Login Page - Create Account

Support Board


Date/Time: Wed, 14 May 2025 05:49:27 +0000



Post From: How to get absolute value of data and how to use math functions in general in Sierra Chart

[2016-03-23 08:04:56]
User972044 - Posts: 154
Hello there,

Can you confirm how to get the absolute value of data. For example I want to get the absolute value of the bar height and currently I am using abs(sc.Open[sc.Index] - sc.Close[sc.Index]) and when I try to output it along with the index value of the bar to debug it, it is NOT working. This is what I am getting from the Message Log:

Chart: AUD.USD-CASH-IDEALPRO 1 Min #1 | Study: Custom DLL Study | Bar height L is: 0.000000 at Index: -1073741824 | 2016-03-23 03:53:00

Why am I getting this gibberish for the Index value when in the code, I specified the index as sc.Index and 0 for the absolute value in the Message line? I inputted "#include <math.h>" and "#include <cmath>" at the beginning of my codes. Is this not correct anymore? If not, can you advise what library files should I have included?

And also I am using other math functions like fmax() and fmin() to process the data as according to the C++ Reference website with the link that you have included in your documentation? Are those still correct?

Please confirm. Thank you for your help.