Login Page - Create Account

Support Board


Date/Time: Thu, 28 Mar 2024 13:53:18 +0000



Two studies with identical values plot differently

View Count: 847

[2019-12-10 00:02:42]
User787032 - Posts: 37
Hi,
I have one study that was created using the Spreadsheet Formula and a second, based on the same formula, that was created as a custom study using ACSIL. The two studies generate lines with identical valuesr, but they plot differently on the chart (attached screenshot).
http://www.sierrachart.com/image.php?Image=1575935972990.png

I've checked that the scaling parameters are set in exactly the same way for both studies.
Are there any other settings that might cause lines with identical values to plot differently?
[2019-12-10 13:58:13]
Sierra Chart Engineering - Posts: 104368
They may be the same at that particular point you show in the chart image, but they can be different elsewhere.

Put those studies in their own Chart Region and set the Scale Range for them to Automatic. Also, select Chart >> Reset Scales.
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-12-10 13:58:36
[2019-12-10 14:26:22]
User787032 - Posts: 37
I checked values of the lines at multiple points on the chart, and the values were always identical.
When I put the two studies in a separate region with automatic scaling, they align perfectly, but if I set scale to independent in that region, they plot differently. I also tried Reset Scales, but it made no difference.
Date Time Of Last Edit: 2019-12-10 14:32:38
[2019-12-10 16:53:56]
Sierra Chart Engineering - Posts: 104368
We are not able to reproduce this. Add two of the same studies to Chart Region 2 with no other studies and set the Scale Range for them to Independent. They will overlap each other exactly.
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-12-10 18:04:01]
User787032 - Posts: 37
I've discovered that if I set the scale to a User Defined Range with the same Top and Bottom values for both studies, then they overlap exactly when placed in the main chart region.
Just to be clear, as I mentioned in the original post, these are not two of the same studies. One is generated using the Spreadsheet Formula study, and the other is coded in ACSIL, reproducing the same formula. As noted earlier, the two lines that are generated have identical values at each bar on the chart, but, for whatever reason, they plot differently.
[2019-12-11 00:10:59]
Sierra Chart Engineering - Posts: 104368
Even when we apply the same study with each one set to Independent scales in Chart Region 1 they do overlap each other. Try this with the Moving average-Simple study.
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-12-11 11:25:50]
User787032 - Posts: 37
I think you're missing the key point: these are not two copies of the same study. One line is generated using the Spreadsheet Formula study. The other line is generated by an ACSIL custom study applying the same formula as that used in the Spreadsheet Formula. The values on each bar produced by the two methods are identical. The only difference is in the way they plot on the chart. If both are set to Independent scale, then they appear as two separate lines with similar shape, but not overlapping and one appearing much flatter than the other (as if it is being plotted on a different scale). If they are both set to User Defined scale with the same top and bottom values, then they overlap exactly.
[2019-12-11 20:15:14]
Sierra Chart Engineering - Posts: 104368
We fully understand that. But we do not understand why there is an issue in your particular case and we are trying to systematically go through this. If you follow through our examples and do not have a problem why would there be a difference with your own studies? This we are not sure about.

Any scale adjustments for those studies would be removed with Chart >> Reset Scales. So there should not be anything unexpected going on with that.
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-12-11 20:15:51
[2019-12-11 22:16:53]
User787032 - Posts: 37
I set up a chart for the ES contract and applied a Simple Moving Average based on the close of each bar, Length 10 (green line in the screenshot.)
I created an ACSIL custom study that computes a simple moving average using the following statement:
  sc.MovingAverage(sc.BaseDataIn[SC_LAST], sc.Subgraph[2], MOVAVGTYPE_SIMPLE, 10);
This study is the magenta line on the chart.
Once again, the values are identical on each bar, and both studies have scale set to Independent, but the lines don't overlap.

Using Chart >> Reset Scales makes no difference.

http://www.sierrachart.com/image.php?Image=157610210354.png
[2019-12-14 10:26:42]
User787032 - Posts: 37
Are you able to reproduce the problem described in my previous post, using a simple moving average?
[2019-12-14 15:24:54]
Sierra Chart Engineering - Posts: 104368
Provide us the source code of your test study and we will do a comparison.
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-12-14 19:25:00]
Blue Brazilian - Posts: 42

#include "sierrachart.h"
#include "scstudyfunctions.h"
SCDLLName("maLine")

SCSFExport scsf_maLine(SCStudyInterfaceRef sc)
{

  if (sc.SetDefaults)
  {
    // Set the configuration and defaults

    sc.GraphName = "MA Line";

    sc.AutoLoop = 1;

    sc.GraphRegion = 0;
    sc.ScaleRangeType = SCALE_INDEPENDENT;
  
    sc.Subgraph[2].Name = "MA10";
    sc.Subgraph[2].SecondaryColorUsed = 0;
    sc.Subgraph[2].PrimaryColor = RGB(255,0,255);
    sc.Subgraph[2].DrawStyle = DRAWSTYLE_LINE;
    sc.Subgraph[2].LineWidth = 2;

    return;
  }

  sc.MovingAverage(sc.BaseDataIn[SC_LAST], sc.Subgraph[2], MOVAVGTYPE_SIMPLE, 10);
  
}

[2019-12-14 20:39:52]
Ackin - Posts: 1863
Remove #include "scstudyfunctions.h"

but it isn't such error...


try change SCALE_INDEPENDENT to another type for example: SCALE_AUTO
Date Time Of Last Edit: 2019-12-14 20:40:06
[2019-12-15 04:17:06]
Sierra Chart Engineering - Posts: 104368
Using the study given in post 12, it overlays the built-in Moving Average-Simple study:
http://www.sierrachart.com/image.php?Image=1576383408619.png

The custom study has the violet color.

What is the Scale Range for the main price graph set to?
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-12-15 04:17:21
[2019-12-15 04:19:14]
Sierra Chart Engineering - Posts: 104368
Also it is clear in this screenshot that you gave, that the Moving Average-Simple study is not using an Independent scale:
http://www.sierrachart.com/image.php?Image=157610210354.png

Because the lowest low is not touching anywhere the bottom of the Chart Region.
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-12-15 04:28:46]
Sierra Chart Engineering - Posts: 104368
We are not sure this is relevant, but we want you to update to the current version of Sierra Chart:
Software Download: Fast Update
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-12-15 04:29:11

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

Login

Login Page - Create Account