Login Page - Create Account

Support Board


Date/Time: Sun, 28 Apr 2024 12:26:25 +0000



[Programming Help] - Spreadsheet Formula Help

View Count: 596

[2020-05-21 07:13:54]
User486817 - Posts: 79
Hello,

I'm new to formula creation and would like to create a formula with the following three conditions:

(ID6.SG1 <=-40)

AND((ID6.SG1[0] > ID6.SG1[-1]) , (ID6.SG1[-1] <= ID6.SG1[-2]))

(ID17.SG8 [0] > ID17.SG8[-1])


I have input the following into the spreadsheet and no matter how i correct it, it returns a syntax error:

=AND((ID6.SG1 <=-40), AND((ID6.SG1[0] > ID6.SG1[-1]) , (ID6.SG1[-1] <= ID6.SG1[-2])) , (ID17.SG8 [0] > SG8[-1]))



If it is possible for someone to help, thank you so much for your kindness.

best regards,
Date Time Of Last Edit: 2020-05-21 07:17:33
[2020-05-21 11:55:24]
Sawtooth - Posts: 3980
If you are using the Spreadsheet Formula study, your formula should work:
=AND((ID6.SG1 <=-40), AND((ID6.SG1[0] > ID6.SG1[-1]) , (ID6.SG1[-1] <= ID6.SG1[-2])) , (ID17.SG8 [0] > ID17.SG8[-1]))

If you are using a spreadsheet study, the syntax is different:
=AND((ID6.SG1@3 <=-40) , AND((ID6.SG1@3 > ID6.SG1@4) , (ID6.SG1@4 <= ID6.SG1@5)) ,(ID17.SG8@3 > ID17.SG8@4))

It could be simplified:
=AND(ID6.SG1@3 <=-40 , ID6.SG1@3 > ID6.SG1@4 , ID6.SG1@4 <= ID6.SG1@5 , ID17.SG8@3 > ID17.SG8@4)

Working with Spreadsheets: References to Study Subgraph Columns when using the Spreadsheet Study
[2020-05-21 12:20:16]
User486817 - Posts: 79
tomgilb,

everything works, your kindness is greatly appreciated. i wish you nothing but the best.

kind regards,

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

Login

Login Page - Create Account