Login Page - Create Account

Support Board


Date/Time: Sat, 10 May 2025 17:14:33 +0000



Subgraph setting different from specified in my codes

View Count: 933

[2016-02-10 01:33:41]
User972044 - Posts: 154
Hi there,

Now that I have had a chance to test the codes for my custom study. I am glad to report that they are working thanks to your help however I noticed that the subgraph output for the chart are not taking the setting that I specified in my codes. For example, I specified the primary color for the the first and second line to be blue and magenta respectively but when I added my custom study, the subgraph plot lines still showed up as red and blue, totally not what I specified in my codes. Also the I specified the line width to be "3" for the lines but in the settings, they still showed up as "1" and I had to manually set them to my desired line width. And I have also specified specific names for each subgraph line but they were not reflected in the chart at all.

Specifically my codes are as follows:

sc.Subgraph[0].Name = "Average";
  sc.Subgraph[0].PrimaryColor = RGB(0, 0, 255); //Blue
  sc.Subgraph[0].DrawStyle = DRAWSTYLE_LINE;       
  sc.Subgraph[0].LineWidth = 3;  

  sc.Subgraph[1].Name = "Smoothed";
  sc.Subgraph[1].PrimaryColor = RGB(255,0,255); //Magenta  
  sc.Subgraph[1].DrawStyle = DRAWSTYLE_LINE;
  sc.Subgraph[1].LineWidth = 3;  
      
I specified them exactly as how they were shown in the sample studies .cpp files. Should I have done something wrong? Please help.

Thanks in advance.
Date Time Of Last Edit: 2016-02-10 01:34:07
[2016-02-12 01:02:01]
Sierra Chart Engineering - Posts: 104368
If you want the Study Subgraphs settings to be always as you have specified in the code, then refer to this documentation here:
http://www.sierrachart.com/index.php?page=doc/doc_ACSILProgrammingConcepts.html#NotAllowingStudySubgraphSettingsChanges
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
[2016-02-12 02:13:08]
User972044 - Posts: 154
I appreciate your help. I modified my codes accordingly and all of the subgraph[] settings are now outside AND after the if (sc.SetDefaults){} block as specified in the documentation but only the line width was taken correctly, the primary color and name of the subgraph[]'s still reverted to the default blue and red and default names and totally ignored what I set in the codes.

It's no big deal but it's just bit of a pain to always have to set it every time.
Date Time Of Last Edit: 2016-02-12 02:25:12
[2016-02-12 03:21:35]
Sierra Chart Engineering - Posts: 104368
This does not make sense. But unless we get a simplified example to test we do not know what to say about this. However, there should never be a problem like 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
[2016-02-12 06:04:25]
User972044 - Posts: 154
I resolved this issue. It turns out I was looking at another study. I thought that when I compile a study, it should automatically show up in the Available Study list but it actually doesn't. I actually have to add it via "Add Custom Study". When I added it, I see that it did show what I specified in the codes.

And then after some debugging of my codes, finally everything is working well now.

Thank you for your help.
Date Time Of Last Edit: 2016-02-12 07:24:09

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

Login

Login Page - Create Account