Login Page - Create Account

Support Board


Date/Time: Thu, 25 Apr 2024 01:18:08 +0000



Histogram

View Count: 1611

[2014-12-08 04:40:11]
User93757 - Posts: 61
Hi,

Is there a reason that Sierra Charts can not include Histogram on Draw Style? Or have i missed something?

Study Settings -> Draw Style

Thx,
[2014-12-08 05:12:38]
Sierra Chart Engineering - Posts: 104368
In Sierra Chart this Draw Style is called "Bar".
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
[2014-12-08 05:50:40]
User93757 - Posts: 61
If I use "Bar", then Sierra will only chart the bar to draw above the "0 line". From my understanding, with a histogram, the (+ value) bars will be greater then "0 line" and the (- value) bars will be less then the "0 Line".

ie. Can i create a histogram with the study "Volume" to look like the attached sample, ty
imageHistogram.PNG / V - Attached On 2014-12-08 05:49:50 UTC - Size: 7.73 KB - 378 views
[2014-12-08 08:36:35]
Sierra Chart Engineering - Posts: 104368
Yes. This will work. When a Subgraph value at a particular chart column is negative, the line will go from 0 down to that negative value.
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
[2014-12-08 12:54:57]
User93757 - Posts: 61
I suppose what i am trying to say, as an example;

Can you take the current volume study and do this without modifying the study or using spreadsheets? The reason i ask; is because i imagine that this feature could be useful on many of the current studies. ty
Date Time Of Last Edit: 2014-12-08 14:29:58
[2014-12-08 16:46:50]
Sierra Chart Engineering - Posts: 104368
No, this does not make any sense. The volume study has positive numbers only.
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
[2014-12-08 17:42:08]
Sierra Chart Engineering - Posts: 104368
Actually, we realize what you want to do.

Here is the source code which will accomplish this:


SCSFExport scsf_VolumeWithNegativeDownVolume(SCStudyInterfaceRef sc)
{
  SCSubgraphRef Volume = sc.Subgraph[0];

  if (sc.SetDefaults)
  {
    sc.GraphName = "Volume - With Negative Down Volume";

    sc.ValueFormat = 0;

    sc.AutoLoop = true;
    sc.ScaleRangeType = SCALE_AUTO;

    Volume.Name = "Volume";
    Volume.DrawStyle = DRAWSTYLE_BAR;
    Volume.PrimaryColor = RGB(0, 255, 0);
    Volume.SecondaryColor = RGB(255, 0, 0);
    Volume.SecondaryColorUsed = 1;
    Volume.LineWidth = 2;
    Volume.DrawZeros = false;


    sc.DisplayStudyInputValues = false;

    return;
  }


  if(sc.Close[sc.Index] >= sc.Open[sc.Index])
  {
    Volume[sc.Index] = sc.Volume[sc.Index];
    Volume.DataColor[sc.Index] = Volume.PrimaryColor;
  }
  else
  {
    Volume[sc.Index] = sc.Volume[sc.Index] * -1;
    Volume.DataColor[sc.Index] = Volume.SecondaryColor;
  }

}

To compile this, refer to the documentation here:
https://www.sierrachart.com/index.php?page=doc/doc_BuildCustomStudiesDLL.html
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
[2014-12-08 18:47:47]
User93757 - Posts: 61
Yes, this is the result i was suggesting. I understand the concept of pos & neg numbers. I guess what i am suggesting (not sure if it can be done) is to have a general setting in the studies or some type of overlay which can distinguish the difference between two colors (ie. green/red --> (sc.Close[sc.Index] >= sc.Open[sc.Index]))..

And therefore draw positive and negative colored bars, based on this idea (histogram). If it can be done, i believe it could be very useful on a lot of the current studies out there.

Thanks for entertaining the idea. I can always learn a bit of code to modify the current studies but i thought a lot of users would like such a feature; or not :) ty

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

Login

Login Page - Create Account