Login Page - Create Account

Support Board


Date/Time: Thu, 16 Jan 2025 19:06:40 +0000



[Programming Help] - sc.SetDefaults Colors

View Count: 1269

[2017-11-18 01:32:51]
CustomIndicators - Posts: 126
I have a few colors that are in my study's settings, but but upon loading the study, all three colors are black, not the colors defined in my sc.Defaults

In a constants.h file, I've got these constants that relate to the issue, just for clarity:
#pragma region Inputs
(other inputs... - I keep all inputs in their own special region to make sure no two are assigned the same number)
const int LONG_CHART_COLOR = 5;
const int SHORT_CHART_COLOR = 6;
const int DEFAULT_CHART_COLOR = 7;
#pragma endregion

In my main study's code file, I have this relevant code:
SCSFExport scsf_MyStudy(SCStudyInterfaceRef sc)
{
  SCInputRef LongChartColor = sc.Input[LONG_CHART_COLOR];
  SCInputRef ShortChartColor = sc.Input[SHORT_CHART_COLOR];
  SCInputRef DefaultChartColor = sc.Input[HYDRA_DEFAULT_CHART_COLOR];

  if (sc.SetDefaults)
   {
    LongChartColor.Name = "Long Chart's Background Color";
    LongChartColor.SetColor(RGB(128, 255, 128)); // Greenish

    ShortChartColor.Name = "Short Chart's Background Color";
    ShortChartColor.SetColor(RGB(255, 128, 128)); // Redish

    DefaultChartColor.Name = "Default Chart Background Color";
    DefaultChartColor.SetColor(RGB(0, 0, 0)); // Black

    return;
   }
}

When I load the study onto a chart, I'm getting this in my settings: (picture attached)

Any idea why this would happen? Shouldn't they all be the colors assigned in the sc.SetDefaults, not all 3 being black?
imageAllBlack.png / V - Attached On 2017-11-18 01:27:23 UTC - Size: 3.79 KB - 349 views
[2017-11-18 01:45:50]
CustomIndicators - Posts: 126
Never mind, I figured it out.

For anyone that runs into this issue and finds this thread, remove the study from the chart, and add it back in. Restarting Sierra Chart won't fix this issue. You actually have to remove, and then add it again.

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

Login

Login Page - Create Account