Login Page - Create Account

Support Board


Date/Time: Thu, 02 May 2024 12:50:13 +0000



color coded board

View Count: 1076

[2015-05-25 19:10:46]
User28682 - Posts: 233
Hi all,

Does anyone have an easy way to color code bars if a condition is met?
Ex: If bar close below 50EMA make the bar yellow?

Thanks in advance!

Tom
[2015-05-25 20:12:55]
Sierra Chart Engineering - Posts: 104368
You can use the Color Bar Based on Alert Condition study:
http://www.sierrachart.com/index.php?page=doc/doc_TechnicalStudiesReference.html#s245
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
[2015-05-28 02:46:54]
User28682 - Posts: 233
"Using the Color Bar Based on Alert Condition study , you are able to color the Subgraphs of other studies"

I just want the bars on the main graph, not subgraphs, to change colors when a condition is met, can I do that? Ex: if bar 1 closes above the 50 sma, color it pink. I tried your steps but nothing happened.

Thanks

Tom
[2015-05-28 05:40:17]
Sierra Chart Engineering - Posts: 104368
The default function of that study is to color the bars without anything special other than entering the Alert Formula.

So it does do what you want.

Use an alert formula of 1, and that will color all of the bars which will validate the study is working properly. If so, the next step is to increase the complexity of the formula step-by-step.

What is the formula you are using?
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
Date Time Of Last Edit: 2015-05-28 05:40:38
[2015-05-28 13:42:33]
User28682 - Posts: 233
Thanks! I'm starting with:

if close is > than 50EMA then color green

if close is < than 50EMA then color red

Tom
[2015-05-28 16:15:34]
User28682 - Posts: 233
I dont understand what this means:

"Use an alert formula of 1, and that will color all of the bars which will validate the study is working properly"

Attached is what I did, but so far nothing happens.

Thanks

Tom
imageEMA_cross.png / V - Attached On 2015-05-28 16:14:54 UTC - Size: 15.75 KB - 318 views
[2015-05-28 17:43:22]
Sierra Chart Engineering - Posts: 104368
You need to understand how to write the alert formulas.

Here is the documentation for this:
https://www.sierrachart.com/index.php?page=doc/doc_AlertCondAndScan.html

Those formulas you have written, are not valid at all to Sierra Chart.
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
[2015-05-28 18:26:15]
User28682 - Posts: 233
Thank you. This doesnt work, but with the following, does this logic make sense:

Studies to Graph:

MACD : ID5
Moving Average Exponential : ID1
Moving Average Exponential : ID3

Alert field:

=AND((ID.5crossover(SG1,SG2),SG1 > 0),C < ID.1.SG1, C > ID3.SG1)

I want a price bar color coded if:

close is < 50 EMA and close > 100 EMA AND MACD SG1 crosses below SG2 AND SG1 is > 0

I am more interested in the price bars changing color on the condition being met than the alert.

Thanks

Tom

Date Time Of Last Edit: 2015-05-28 19:49:53
[2015-05-31 14:34:03]
User28682 - Posts: 233
Hi, does this seem correct?

Thanks

Tom
[2015-05-31 17:49:12]
Sawtooth - Posts: 3990
This is the correct syntax, except it produces very few colored bars:

=AND(CROSSOVER(ID5.SG1,ID5.SG2),ID5.SG1>0,C<ID1.SG1,C>ID3.SG1)

However, you have given several disparate conditions so it's difficult to provide an exact formula.
To be self-sufficient at writing formulas:
-study the syntax examples at the link provided in post #7.
-try a simplistic formula so that you can see success.
-build the formula in steps to what your final alert conditions will be.
-you'll need a separate instance of the Color Bar Based On Alert Condition study for each color.

[2015-06-01 04:54:02]
User28682 - Posts: 233
Does "CROSSOVER" mean from "under to over", "from over to under", or both? or is there a term for each of these? I read your info on it and not sure.

Thanks

Tom
[2015-06-01 08:02:17]
Sierra Chart Engineering - Posts: 104368
It can mean both and it is documented here:
http://www.sierrachart.com/index.php?page=doc/doc_SpreadsheetFunctions.html
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
[2015-06-02 03:15:38]
User28682 - Posts: 233
Hi,

Previous facts:

MACD : ID5
Moving Average Exponential : ID1
Moving Average Exponential : ID3

Alert field:

=AND((ID.5crossover(SG1,SG2),SG1 < 0),C < ID.1.SG1, C > ID3.SG1)

I want a price bar color coded if:

close is < 50 EMA and close > 100 EMA AND MACD SG1 crosses below SG2 AND SG1 is > 0

I am more interested in the price bars changing color on the condition being met than the alert.


If I want this "buy" condition met with a pink bar, based on these facts, do I need 1 "Color Bar Based On Alert Condition" to show "buy" examples as this code wants? If so where does it go in the list of Studies to graph? Attached is what I have now, using only one.I cant get it to show ANY colored bars, where is the setting to tell it to do it and what color to do it?

Thanks for your help.

Tom
imageColor_Bar_Based_on_Alert.png / V - Attached On 2015-06-02 03:14:29 UTC - Size: 88.86 KB - 298 views
[2015-06-02 15:29:37]
User28682 - Posts: 233
Thanks for all, I got it to work. How does one change the color for a bar?

Tom

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

Login

Login Page - Create Account