Support Board
Date/Time: Sat, 08 Feb 2025 06:27:57 +0000
[Programming Help] - ALERT Not Working
View Count: 663
[2020-06-29 16:08:56] |
User19100 - Posts: 9 |
Previously, you assisted me with creating an alert that would trigger 5 minutes before the top of the hour. It works great, by the way. Thank you. I'm very new to this type of thing all together but attempted to use snippets from the code you helped me with to create another alert with different parameters. I was unable to replicate the outcome. Here is the code with which you previously assisted. =IF(ROW()=3,AND(ID16.SG1@4<ID17.SG3@4,ID16.SG1@3>ID17.SG3@3,ID15.SG1@4<ID15.SG1@3,ID15.SG2@4<ID15.SG2@3,ID13.SG1@4<ID13.SG1@3,ID14.SG1@4<ID14.SG1@3,FRACTIME($J$41)-(HOUR(FRACTIME($J$41))/24)>=55/1440,FRACTIME($J$41)-(HOUR(FRACTIME($J$41))/24)<60/1440),0) The new code, with which I am working is the following. I would like to have it also alert 5 minutes before the top of the hour. =AND(ID15.SG1[-1]>ID15.SG1, ID15.SG2[-1]>ID15.SG2, ID13.SG1[-1]>ID13.SG1, ID14.SG1[-1]>ID14.SG1,O<C) Any assistance would be greatly appreciated. |
[2020-06-29 17:58:29] |
Sawtooth - Posts: 4173 |
Just to be clear, I'm only a user; I'm not SC support. Also, it would be helpful if you post followup question in the same thread. To replicate the formula, but with different conditions, try this: =IF(ROW()=3,AND(ID15.SG1@4>ID15.SG1@3,ID15.SG2@4>ID15.SG2@3,ID13.SG1@4>ID13.SG1@3,ID14.SG1@4>ID14.SG1@3,O<C,FRACTIME($J$41)-(HOUR(FRACTIME($J$41))/24)>=55/1440,FRACTIME($J$41)-(HOUR(FRACTIME($J$41))/24)<60/1440),0) This is the portion that finds the 5 minutes before the bar close: FRACTIME($J$41)-(HOUR(FRACTIME($J$41))/24)>=55/1440,FRACTIME($J$41)-(HOUR(FRACTIME($J$41))/24)<60/1440 This limits the alert to only the current bar: =IF(ROW()=3,AllConditions,0) Date Time Of Last Edit: 2020-06-29 20:45:55
|
[2020-06-29 19:13:31] |
User19100 - Posts: 9 |
@tomgilb - Thank you for your reply. When I tried the line you posted, I received a Syntax error. Attached is my previous question and reply which resolved my first issue.
|
GreenChart 5 min to post.jpg / V - Attached On 2020-06-29 19:12:41 UTC - Size: 303.19 KB - 267 views |
[2020-06-29 19:31:00] |
Sawtooth - Posts: 4173 |
hen I tried the line you posted, I received a Syntax error
I fixed it in post #2. Try it again please.
|
[2020-06-29 20:09:27] |
User19100 - Posts: 9 |
@tomgilb I copy/pasted the code and, again, received a Syntax Error. Here is what I attempted. =IF(ROW()=3,AND(ID15.SG1[-1]>ID15.SG1,ID15.SG2[-1]>ID15.SG2,ID13.SG1[-1]>ID13.SG1,ID14.SG1[-1]>ID14.SG1,O<C,FRACTIME($J$41)-(HOUR(FRACTIME($J$41))/24)>=55/1440,FRACTIME($J$41)-(HOUR(FRACTIME($J$41))/24)<60/1440),0) On the previous fix, it appears that an "@" was used to replace [-1] and the like. |
[2020-06-29 20:49:58] |
Sawtooth - Posts: 4173 |
My bad. Post #2 has been edited again. Spreadsheet syntax is not the same as Simple Alert syntax. In spreadsheet syntax, the current bar is @3, the previous bar is @4. In Simple Alert syntax, the current bar is [0] or blank, the previous bar is [-1]. |
[2020-06-30 20:18:58] |
User19100 - Posts: 9 |
@tomgilb - Ok, This is the code I used and it didn't give me a Syntax error but it's not setting off the ALERT. I tried testing in in replay mode and waiting for it to occur live and neither of them set off the alert. I put in a functioning code to see if it would set off the alert and it did. There's something not working correctly in this string. I tried referencing the open and close differently but then it alerted for every candle where O>C. I tried saying C@4>C@3. I tried O@3>C@3 and, of course, simply O>C. =IF(ROW()=3,AND(ID15.SG1@4<ID15.SG1@3,ID15.SG2@4<ID15.SG2@3,ID13.SG1@4<ID13.SG1@3,ID14.SG1@4<ID14.SG1@3,O>C,FRACTIME($J$41)-(HOUR(FRACTIME($J$41))/24)>=55/1440,FRACTIME($J$41)-(HOUR(FRACTIME($J$41))/24)<60/1440),0) I'm stumped... Again, thanks for your help. You're an ALLSTAR! |
[2020-07-01 00:31:25] |
Sawtooth - Posts: 4173 |
I'm sorry, again. If this is for a spreadsheet study spreadsheet, use this: =IF(ROW()=3,AND(ID15.SG1@4<ID15.SG1@3,ID15.SG2@4<ID15.SG2@3,ID13.SG1@4<ID13.SG1@3,ID14.SG1@4<ID14.SG1@3,B3>E3,FRACTIME($J$41)-(HOUR(FRACTIME($J$41))/24)>=55/1440,FRACTIME($J$41)-(HOUR(FRACTIME($J$41))/24)<60/1440),0) The current bar's Open is cell B3, the current bar's Last/Close is cell E3. Note: I did not test this. |
[2020-07-01 18:20:34] |
User19100 - Posts: 9 |
@tomgilb - GENIUS! It works!!! Thank you so very much for your help. Life saver! |
To post a message in this thread, you need to log in with your Sierra Chart account: