Support Board
Date/Time: Fri, 29 Nov 2024 22:53:44 +0000
[Programming Help] - question
View Count: 511
[2023-01-03 19:00:24] |
User427561 - Posts: 217 |
keep getting an error with the following formula syntax: =and((id2.sg1>id2.sg1[-1]),(id2.sg1[-1]<id2.sg1[-2])) can you tell me what's wrong with it? thanks |
[2023-01-04 18:49:30] |
User183724 - Posts: 183 |
I ran your alert and didn't receive an error. do you actually have a id2.sg1? something i always do is add a [0] to the end of my subgraph ids that wouldnt normally have a bracket... just to keep it uniform. sometimes it helps debugging... the '=' isn't required on simple alerts in the Color Bar Based On Alert Condition... one more thing... I add spaces between parentheses to make it easier to see if I have them all... so this is what mine looks like. no errors. and( (id2.sg1[0]>id2.sg1[-1]) , (id2.sg1[-1]<id2.sg1[-2]) ) |
[2023-01-05 03:54:37] |
Sawtooth - Posts: 4122 |
The formula is using correct Alert syntax. It would give a syntax error if used on a spreadsheet. The spreadsheet syntax would be: =AND(ID2.SG1@3>ID2.SG1@4 , ID2.SG1@4<ID2.SG1@5) |
[2023-01-09 21:36:27] |
User427561 - Posts: 217 |
I cpied and pasted your "no error formulaon my chart and stipp got an erro it looks like that: Alert Formula Error - Chart: ESH23-CME[M] 1 Min #2 | Study: 10marevarUPid25 | Error: #SYNTAX! | Formula: =AND( (ID2.SG1[0]>ID2.SG1[-1]) , (ID2.SG1[-1]<ID2.SG1[-2]) ) Alert Formula Error - Chart: ESH23-CME[M] 1 Min #2 | Study: 10marevarUPid25 | Error: #SYNTAX! | Formula: =AND( (ID2.SG1[0]>ID2.SG1[-1]) , (ID2.SG1[-1]<ID2.SG1[-2]) ) I cpied and pasted your No alert formula verbatum on my chart and still got an alert as follows: Alert Formula Error - Chart: ESH23-CME[M] 1 Min #2 | Study: 10marevarUPid25 | Error: #SYNTAX! | Formula: =AND( (ID2.SG1[0]>ID2.SG1[-1]) , (ID2.SG1[-1]<ID2.SG1[-2]) ) I copied and pasted your no error f0rmula verbatum on me program and this is the response I got: Alert Formula Error - Chart: ESH23-CME[M] 1 Min #2 | Study: 10marevarUPid25 | Error: #SYNTAX! | Formula: =AND( (ID2.SG1[0]>ID2.SG1[-1]) , (ID2.SG1[-1]<ID2.SG1[-2]) ) I did not put = sign ahead in the formula I posted, but the response showed one. 0 | No alert sound/email. 0 | No alert sound/email. |
[2023-01-10 03:12:48] |
User183724 - Posts: 183 |
and( (id2.sg1[0]>id2.sg1[-1]) , (id2.sg1[-1]<id2.sg1[-2]) ) works on mine. Im putting it a Color Bar Based On Alert Condition study. turns my bars Blue. ... see the attached picture. Must be something on wrong with your program https://www.sierrachart.com/image.php?Image=1673320329467.png |
[2023-01-10 14:57:27] |
User427561 - Posts: 217 |
I copied and pasted your formula verbatum on my chart and still got an error per attached; SELL1stoslorvear<DNreg1.id23 can you explain? |
[2023-01-10 15:02:07] |
User427561 - Posts: 217 |
I cpied and pasted your "no error formulaon my chart and stipp got an erro it looks like that: Alert Formula Error - Chart: ESH23-CME[M] 1 Min #2 | Study: 10marevarUPid25 | Error: #SYNTAX! | Formula: =AND( (ID2.SG1[0]>ID2.SG1[-1]) , (ID2.SG1[-1]<ID2.SG1[-2]) ) can you explain? |
[2023-01-10 15:03:19] |
User427561 - Posts: 217 |
I cpied and pasted your "no error formulaon my chart and stipp got an erro it looks like that: Alert Formula Error - Chart: ESH23-CME[M] 1 Min #2 | Study: 10marevarUPid25 | Error: #SYNTAX! | Formula: =AND( (ID2.SG1[0]>ID2.SG1[-1]) , (ID2.SG1[-1]<ID2.SG1[-2]) ) |
[2023-01-10 15:18:39] |
User427561 - Posts: 217 |
I cpied and pasted your "no error formulaon my chart and stipp got an erro it looks like that: Alert Formula Error - Chart: ESH23-CME[M] 1 Min #2 | Study: 10marevarUPid25 | Error: #SYNTAX! | Formula: =AND( (ID2.SG1[0]>ID2.SG1[-1]) , (ID2.SG1[-1]<ID2.SG1[-2]) ) |
[2023-01-10 17:17:00] |
User183724 - Posts: 183 |
the first thing i would try is putting it a Color Bar Based On Alert Condition study and see if that works. if that works, youll need to re evaluate what you are attempting to do. if it doesnt, you may have a bug in your software and may need to re install it. |
To post a message in this thread, you need to log in with your Sierra Chart account: