Login Page - Create Account

Support Board


Date/Time: Tue, 23 Apr 2024 06:26:01 +0000



How to change bar color from study that on chart region 2

View Count: 2188

[2019-04-19 22:19:37]
patternsmart - Posts: 6
Hi

I know that we can change the bar/candle color from a study by using DRAWSTYLE_COLOR_BAR, such as "Color Bar HH/LL"

But it seems that it only works when the study sc.GraphRegion = 0;

If I need to change to bar/candle color from a study with sc.GraphRegion = 1 (plot in region 2); what should I do?

I need it to be done within the same study, not from another study.

Thanks.
[2019-04-22 01:56:27]
patternsmart - Posts: 6
Any help will be great.
[2019-05-02 19:15:06]
patternsmart - Posts: 6
Nobody knows?
Or it's not possible to do?
[2019-05-02 20:25:51]
Ackin - Posts: 1865
I think it's not possible without ACSIL or Spreadsheet...
Date Time Of Last Edit: 2019-05-02 20:27:17
[2019-05-06 05:44:14]
Sierra Chart Engineering - Posts: 104368
This is fully supported. If there is a problem we need to look into why that would be the case.
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
[2019-05-09 16:56:05]
Sierra Chart Engineering - Posts: 104368
We have tested this and definitely no problem with this:

I know that we can change the bar/candle color from a study by using DRAWSTYLE_COLOR_BAR, such as "Color Bar HH/LL"

But it seems that it only works when the study sc.GraphRegion = 0;

If I need to change to bar/candle color from a study with sc.GraphRegion = 1 (plot in region 2); what should I do?

Make sure the scale of the study which is using DRAWSTYLE_COLOR_BAR is set to Automatic and also the other study in the chart region which is displaying price bars. Another thing to check is the study display order:
Chart Studies: Study Display Order

If there is any further issue let us know. One simple test you can do is add the Heikin Ashi study to chart region 2 and then also add the Color Bar Based on Alert Condition study to the same chart region and set the formula to 1. The bars will all be colored. This is a good way to validate this functionality works. This is what we did.

And we apologize for the long delay. Just we are quite busy. Originally we were thinking of setting up a test study for this until we thought of the above .
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: 2019-05-09 16:57:28
[2019-05-09 18:25:11]
Ackin - Posts: 1865
There are more questions.
I was answering in #4 on this ...
If I need to change to bar/candle color from a study with sc.GraphRegion = 1 (plot in region 2); what should I do?
that it is not possible to have a situated study in one region and paint to another region without ACSIL or Spreadsheet, of course, it is possible to take data from region 1 and plot in another study in region 2 as you write



Can I have a question / suggestion in this case? If I have a study and would like to make a calculation in one region and also a view (such as an oscillator) but I want to display the alerts in the main chart (region 0), are there other ways instead of tools or duplicating the study?

Example:
I have SG1 output in Region 2 but SG2 has output in Region 0 from same study.

I'm just asking if there's some way about which I don't know.
Date Time Of Last Edit: 2019-05-09 18:54:58
[2019-05-09 18:56:52]
patternsmart - Posts: 6
Here is my code, please let me know why it doesn't paint the price bar.


#include "sierrachart.h"


SCDLLName("Color Bar")
/*==========================================================================*/
SCSFExport scsf_ColorBar(SCStudyInterfaceRef sc)
{
  SCSubgraphRef ColorBar = sc.Subgraph[0];
  SCSubgraphRef RSI = sc.Subgraph[1];

  if (sc.SetDefaults)
  {
    // Set the configuration and defaults
    
    sc.GraphName = "Color Bar";
    
    sc.StudyDescription = "This study function colors bars based on RSI";
    
    sc.GraphRegion = 1;
    
    ColorBar.Name = "Color Bar";
    ColorBar.DrawStyle = DRAWSTYLE_COLOR_BAR;
    ColorBar.SecondaryColorUsed = 1; // true
    ColorBar.PrimaryColor = RGB(0,255,255);
    ColorBar.SecondaryColor = RGB(255, 127, 0);

    RSI.Name = "RSI";
    RSI.DrawStyle = DRAWSTYLE_LINE;
    RSI.PrimaryColor = RGB(255,127,0);

    sc.AutoLoop = 1;
    sc.FreeDLL = 1;
    
    return;
  }
    
  // Do data processing
  
  sc.RSI(sc.Close, RSI, MOVAVGTYPE_SIMPLE, 14);
  
  if (RSI[sc.Index] > 50)
  {
    ColorBar[sc.Index] = 1;
    ColorBar.DataColor[sc.Index] = ColorBar.PrimaryColor;
  }
  else
  {
    ColorBar[sc.Index] = 1;
    ColorBar.DataColor[sc.Index] = ColorBar.SecondaryColor;
  }
}
[2019-05-10 00:31:23]
Sierra Chart Engineering - Posts: 104368
Are there already price bars displayed in Chart Region 2?

It is only going to color the price bars in chart region 2 assuming that there are bars there to begin with.
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: 2019-05-10 00:32:25
[2019-05-10 00:51:35]
patternsmart - Posts: 6
The study is in Chart Region 2, I need it to color the main chart price bar(Chart Region 1).
Is it possible?
[2019-05-10 00:55:40]
Sierra Chart Engineering - Posts: 104368
Ok now we finally understand. No, this is not possible. You need a separate study for this.
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
[2019-05-10 01:04:26]
patternsmart - Posts: 6
OK, thanks

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

Login

Login Page - Create Account