Login Page - Create Account

Support Board


Date/Time: Fri, 27 Dec 2024 01:01:31 +0000



[Programming Help] - Color Background

View Count: 984

[2016-04-07 17:51:27]
User35326 - Posts: 57
SC:

Is it possible to color the background of a chart when the last price is in between two lines on a study, like the keltner lines? For example, if the current price is below the top keltner and above the lower keltner then color the background but only the backgound in between the upper and lower keltner lines. The area above the upper keltner and below the lower keltner would not receive the colored background.

Right now it is possible to color the background on the chart when we are below the upper keltner and above the lower keltner; but, the color background extends all the way up and down the chart at that point.

I hope this will make sense to you.

Thanks in advance.
[2016-04-08 13:18:11]
User35326 - Posts: 57
Does no response from SC support mean that the type of color background mentioned in my post above is not available in SC?
[2016-04-09 09:41:42]
Sierra Chart Engineering - Posts: 104368
We are not really understanding this accurately and it is not within the scope of our support to try to understand this from a text description.

Have a look at the Color Background Based on Alert Condition study:
https://www.sierrachart.com/index.php?page=doc/doc_TechnicalStudiesReference.html#s252
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: 2016-04-09 09:41:59
[2016-04-09 14:33:35]
Sawtooth - Posts: 4143
You can do this with the Spreadsheet Study study, sort of.
(Need Fill Top-Skip Zeros & Fill Bottom-Skip Zeros Draw Styles to do it better)

Add the Spreadsheet Study study
-Set the Chart Region to 1
-Check 'Draw Study Underneath Main Price Graph'
-Give it a name in the Spreadsheet Name field
-Set the Draw Style of K(SG1) to Fill Top, and choose color
-Set the Draw Style of L(SG2) to Fill Bottom
-Click OK and OK
On the spreadsheet, use these formulas in cells K3 and L3:
K3:
=IF(AND(E3<ID1.SG2@3,E3>ID1.SG3@3),ID1.SG2@3,0)
L3:
=IF(AND(E3<ID1.SG2@3,E3>ID1.SG3@3),ID1.SG3@3,0)
where ID1 is the Keltner study. (E3 is the Last price).

Edit the ID# as necessary.

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

Login

Login Page - Create Account