Login Page - Create Account

Support Board


Date/Time: Sun, 24 Nov 2024 17:44:13 +0000



LN function

View Count: 245

[2024-05-13 12:31:25]
User411320 - Posts: 289
Hello, I'm using LN in the spreadsheet =LN(E3-E4) where E is "last" price. I'm getting #NUM! for some values. According to the documentation that's because the number is less than or equal to 0. so my question is how do I fix that ?
[2024-05-13 16:58:29]
John - SC Support - Posts: 36238
You can not fix this. You can not take the log (natural or otherwise) of a negative number. Keep in mind a Log is the power you need to raise a value to in order to get the desired number. This is why you can not take a log of a negative number.

The only thing we can suggest is taking the Absolute Value of "E3 - E4" (LN(ABS(E3-E4)), but we do not know if this actually what you want.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-05-16 17:26:08]
User411320 - Posts: 289
hello,

I'm trying to do this "Ln(Close) - Ln(Close1) : Close1 is previous close", so I can normalize data. I also tried the formula you gave me but it gave me a syntax error
[2024-05-16 17:55:58]
John - SC Support - Posts: 36238
The following formula works for us:
=LN(ABS(E3 - E4))

You can do what you suggested with this "Ln(Close) - Ln(Close1)" as each close is a positive value. So the formula would be the following:
=LN(E4) - LN(E3)
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-05-18 19:34:18]
User411320 - Posts: 289
thank you that worked

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account