Login Page - Create Account

Support Board


Date/Time: Wed, 12 Feb 2025 11:35:34 +0000



[Programming Help] - Study Overlay not accurate

View Count: 1414

[2020-10-22 14:38:42]
User202740 - Posts: 12
Hi,

I'm trying to overlay the moving average of the 60 minutes chart into 5 minutes chart but the result is not accurate, as you can see in the attached figure.

The left chart is the 5 minutes chart with the overlayed Moving Average from the right chart (60 minutes). As you can see in the overlayed moving average is below the high of the candle whereas in the 60 minutes chart it is exactly on the top of the candle.

I've tried to change the settings but it doesn't work.

Any help please?
imageImage1.PNG / V - Attached On 2020-10-22 14:37:57 UTC - Size: 94.51 KB - 287 views
Attachment Deleted.
[2020-10-22 14:50:45]
John - SC Support - Posts: 37891
Can you please attach a Chartbook with those two charts in them and just the studies that are relevant to this issue. Refer to the information here for how to create and attach the Chartbook:
Support Board Posting Information: Providing Chartbook with Only a Single Chart
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2020-10-22 17:58:50]
User202740 - Posts: 12
Sure. Here you got attached the chartbook.

If you need any further information, please let me know.
attachmentoverlay_error.Cht - Attached On 2020-10-22 17:57:53 UTC - Size: 5.58 KB - 319 views
[2020-10-22 18:42:59]
John - SC Support - Posts: 37891
The main issue is how you are displaying the data. You have the option for Fill Blanks with Last Value set to No. This means that the only data points that are absolutely correct are the ones that match at the same time of the opening of the bar (in other words, if there is a new bar at 18:15 in the 1 hour chart, then only the bar at 18:15 in the 15 minute chart is correct.

Otherwise, what you are seeing is a line drawn from the point at the one bar that matches to the point on the next bar that matches up (i.e. 60 minutes later). This is why you are seeing a line that has a non-zero slope to it.

Refer to the information on this here:
Study/Price Overlay Study: Fill Blanks with Last Value
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2020-10-22 22:32:18]
User202740 - Posts: 12
I'd tried with Fill Blanks with Last Value set to Yes but then the overlapped line likes a trapezoid and it doesn't touch it. Maybe I'm misunderstanding some concepts regarding the overlay study...

I would like to get something more accurate when plotting the 60 minutes MA into 5 minutes chart. One person uses the following code:

Inputs: length(20);
If CurrentBar = 240 then Value1 = xaverage(C, 240);
If CurrentBar > 240 then begin
If Fracportion((time – 30)/100) = 0 or time =1315 then begin
value1 = value1[1] + (2 / ( Length + 1 )) * ( C – value1[1] );
Value2 = value1;
Plot1(value1, "60 min 20EMA");
end
else begin
Value2 = value1 + (2 / ( Length + 1 )) * ( C – value1[1] );
Plot1(value2, "60 min 20EMA");
end;end;

But I'm not sure if SierraChart's overlay study overlays like that way.
Date Time Of Last Edit: 2020-10-22 23:43:19
[2020-10-23 13:37:35]
John - SC Support - Posts: 37891
The Study/Price Overlay does not work in the way you have described above. It just takes the data from the other chart and overlays it onto the chart you want, directly, with no modifications to the data. Therefore, when you set Fill Blanks with Last Value to Yes, then you are seeing the data point from the 1 hour chart actually depicted on each of the 15 minute bars that make up that one hour.

To do something like what you have above you would need to use the Spreadsheet Study. Refer to the information here:
Overview of Spreadsheet Studies
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2020-10-23 14:13:31]
User202740 - Posts: 12
Thank you for your answers! I'll try it then
[2020-10-23 18:48:07]
Sierra Chart Engineering - Posts: 104368
You can also use ACSIL:
Advanced Custom Study Interface and Language (ACSIL)
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

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

Login

Login Page - Create Account