Login Page - Create Account

Support Board


Date/Time: Mon, 06 May 2024 17:52:26 +0000



[Programming Help] - Alert color background condition SG 1 and SG 2 same color formula

View Count: 1191

[2019-03-02 11:52:06]
User199100 - Posts: 9
Would like to create an alert background condition when one study indicator give me the same color ( SG 1 is green and SG 2 is green )how can input this condition with a formula and vice versa for red to short.

Thank you community for your help and Sierra
[2019-03-03 03:04:17]
Xfanman1 - Posts: 320
Use the Color Background Based on Alert Condition Study. If you want a Long and Short version you'll need to add it twice and put your Long and Short alerts in seperate studies. Create your condition that's going to signal the color background change. In your case

=AND(ID1.SG1>ID1.SG1[-1],ID1.SG2>ID1.SG2[-1])

Not knowing what your SG1 and SG2 conditions are I'm assuming these would be some sort of Moving Average and you're looking for a positive slope in both. The alert above will tell you when the value of SG1 is greater than the value of SG1 in the previous bar indicating a positive trend. The same for SG2. The alert then says that both conditions must be true for your alert to work. Substitute your actual study ID in place of my ID1 above and that should work. If SG1 and SG2 are not moving averages then you may need a different formula.

--
Scott
Date Time Of Last Edit: 2019-03-03 03:05:27
[2019-03-03 11:19:35]
User199100 - Posts: 9
Thank you Scott for your prompt reply and the formula you provided. The indicator that i'm using an indicator that both SG 1 and SG 2 must be both same color to be true in order to execute the trade. - It's not a moving average indicator.

Lou

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

Login

Login Page - Create Account