Login Page - Create Account

Support Board


Date/Time: Tue, 26 Nov 2024 16:49:54 +0000



[Programming Help] - Region Background Color

View Count: 1562

[2020-06-24 15:02:46]
User969241 - Posts: 95
How do I change the background color of a region?
[2020-06-24 15:15:54]
Ackin - Posts: 1865
Hi, I think there is no setting for a different region color because changing the background color will change both the main chart and the regions ....
But you can try the study "Color Bacground Based on alert Condition"

In the settings and input tab change chartregion to your number
and put condition =C in the alert tab
[2020-06-25 21:41:38]
Sierra Chart Engineering - Posts: 104368
Yes this is true. There is only one chart background color.
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
[2021-03-10 10:00:22]
Giamsterdam - Posts: 33
My Region 2 is of a different color, im trying to remove that.
imageSierraChart_64_YPnOSgcT2N.png / V - Attached On 2021-03-10 09:59:54 UTC - Size: 70.7 KB - 340 views
[2021-03-10 17:04:32]
John - SC Support - Posts: 36300
Are there any other studies in Region 2 besides the Average True Range?
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2023-11-15 12:23:14]
gtaranti - Posts: 68
I tried Ackin's solution and it works!
But the strange thing is, that after adding the "Color Bacground Based on alert Condition" study, the scale text for the specific region disappears (or go to black ?)
How to solve this? ie. get back white scale text on region#2

Screenshot attached, with 3 regions.
2nd region has the aforementioned study added, and bg to gray.

https://www.sierrachart.com/image.php?Image=1700051351320.png
Date Time Of Last Edit: 2023-11-15 12:29:35
[2023-11-15 15:54:41]
John - SC Support - Posts: 36300
Please get us that chart so we can take a look at what is occurring with the scale, by following these instructions:
Support Board Posting Information: Providing Chartbook with Only a Single Chart
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2023-11-15 16:11:03]
gtaranti - Posts: 68
Here it is...
attachmentRegion2_without_scale.Cht - Attached On 2023-11-15 16:09:45 UTC - Size: 5.27 KB - 433 views
Attachment Deleted.
[2023-11-15 23:57:38]
User719512 - Posts: 264
Interesting approach with CBBOAC.
Can also be done in ACSIL and GDI functions.

Code Snippet:


void DrawToChart(HWND WindowHandle, HDC DeviceContext, SCStudyInterfaceRef sc)
{
// easier to see in the debugger with locals
const int region_left = sc.StudyRegionLeftCoordinate;
const int region_top = sc.StudyRegionTopCoordinate;
const int region_right = sc.StudyRegionRightCoordinate;
const int region_bottom = sc.StudyRegionBottomCoordinate;

n_ACSIL::s_GraphicsRectangle Rectangle;
n_ACSIL::s_GraphicsColor Color;

Rectangle.Left = region_left;
Rectangle.Top = region_top;
Rectangle.Right = region_right;
Rectangle.Bottom = region_bottom;
Color.Color.RawColor = sc.Input[0].GetColor();
sc.Graphics.FillRectangleWithColor(Rectangle, Color);
}

I would have thought this study should be first in the list (and draw underneath the main subgraph), but I had to put it last for it to work as expected.
imageScreenshot 2023-11-15 154637.png / V - Attached On 2023-11-15 23:53:56 UTC - Size: 67.68 KB - 93 views
[2023-11-16 07:03:51]
gtaranti - Posts: 68
Hey, thank you User719512 for the suggestion to move around the study !!

After moving the "Color Background Based on alert Condition" study last on the list of studies, I've got the region scale back.
Now it works..

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

Login

Login Page - Create Account