Login Page - Create Account

Support Board


Date/Time: Wed, 01 Jan 2025 13:49:50 +0000



Formula for Color Background

View Count: 1122

[2016-05-18 12:35:02]
User28914 - Posts: 87
I would like to write a formula using the color background base on Alert condition (unless there is a better study)

ID9.SG1=CCI line
ID9.SG3= +100 line
ID9.SG4= -100 line

ID7.SG1=LR9
ID6.SG1=LR4


When the CCI line crosses the +100 and LR4 crossed LR9 going down
=AND(ID9.SG1 crosses downward ID9.SG3) and (ID6.SG1 crossed upward ID7.SG1)

When the CCI line crosses the -100 and LR4 crosses the LR9 going up
=AND(ID9.SG1 crosses upward ID9.SG3) and (ID6.SG1 crossed downward ID7.SG1)

With Shadowtrades there was an angle degree that could be assigned to a moving average so it showed 20 degrees or 45 degrees on the chart,; does the study angle do this somehow?
[2016-05-18 13:14:23]
jackw - Posts: 57
AND(CROSSFROMABOVE(ID9.SG1,ID9.SG3),CROSSFROMBELOW(ID6.SG1,ID7.SG1))
AND(CROSSFROMBELOW(ID9.SG1,ID9.SG3),CROSSFROMABOVE(ID6.SG1,ID7.SG1))

Place each of the above alerts in a separate 'Color Background on an Alert Condition' study. If you wish to combine them into a single alert, then the formula would look like this:

OR(
AND(CROSSFROMABOVE(ID9.SG1,ID9.SG3),CROSSFROMBELOW(ID6.SG1,ID7.SG1)),
AND(CROSSFROMBELOW(ID9.SG1,ID9.SG3),CROSSFROMABOVE(ID6.SG1,ID7.SG1))
)

You can also add the 'Study Angle' study to your chart and hide it. You can then reference that result in your alert formulas.
Date Time Of Last Edit: 2016-05-18 17:17:56
[2016-05-18 17:07:56]
User28914 - Posts: 87
I typed in =AND(ID9.SG1,ID9,SG3),(ID6.SG1,ID7.SG1)
=AND(ID9.SG1,ID9.SG3),(ID6.SG1,ID7.SG1) error:#SYNTAX!
Two separate color background based on alert condifition
Thank you Chris Hageman
[2016-05-18 17:19:08]
jackw - Posts: 57
Sorry about that. I edited my post above and fixed the syntax errors.
[2016-05-18 17:39:35]
Sierra Chart Engineering - Posts: 104368
Here is the documentation for Study Angle:
https://www.sierrachart.com/index.php?page=doc/doc_TechnicalStudiesReference.html#s231
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing

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

Login

Login Page - Create Account