Login Page - Create Account

Support Board


Date/Time: Thu, 18 Apr 2024 23:12:17 +0000



Moving Linear Regression not calculated properly?

View Count: 1350

[2015-11-30 02:26:30]
umair1 - Posts: 86
I'm using the Moving Linear Regression study with a period of 200 based on the LAST price on a daily chart of CADCHF which goes back farther than 200 days. I noticed over the last 20-30 bars it appears that the Moving Linear Regression is not being calculated properly. Starting on 10/22/2015 CADCHF begins increasing, but the moving average begins decreasing. I don't believe this is correct. See attached.
imagelsma.png / V - Attached On 2015-11-30 02:22:34 UTC - Size: 111.28 KB - 299 views
[2015-11-30 03:01:29]
Sierra Chart Engineering - Posts: 104368
The calculation is going to work consistently at every bar. We think the calculation is being affected by the bars around the large price decline.

With a Length input setting of 200 are those bars around the large decline included in the calculation?
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: 2015-11-30 03:01:49
[2015-11-30 03:12:02]
Sierra Chart Engineering - Posts: 104368
If you draw a Linear Regression Chart Drawing over the 200 bars, you can then see the values as you move that Chart Drawing.
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: 2015-11-30 03:12:37
[2015-11-30 03:22:42]
umair1 - Posts: 86
I used the "bar numbering" study to label 200 bars back. 200 bars back means the first (earliest) bar should be 2/24/2015. I believe the large decline you're talking about is when they unpegged CHF to EUR on 1/15/2015- so this is not included in the calculation. See attached.
imagelsma 200 bars.png / V - Attached On 2015-11-30 03:22:24 UTC - Size: 120.73 KB - 369 views
[2015-11-30 03:30:41]
umair1 - Posts: 86
I used the Linear Regression chart drawing tool and the Linear Regression value is 0.7266 which is a local minimum on 10/21/2015 (the date where the Moving Linear Regression study suddenly changes slope from positive to negative). The Linear Regression value then gradually increases after 10/21/2015 so the Moving Linear Regression should be increasing as well.
Date Time Of Last Edit: 2015-11-30 03:32:41
imagelsma 200 bars measurement.png / V - Attached On 2015-11-30 03:30:31 UTC - Size: 125.27 KB - 303 views
[2015-11-30 04:02:24]
Al SC Developer - Posts: 434
If you do your counting properly, you will see that the large range bar is included at the break point. The linked image below shows the 200 bar count from the end and again from the break point in the avg line (it is 28 bars back shown with the pink/orange markers at the bottom). In the attached image, I also drew two 200-bar linear regression tools that cover the indicated areas, and you can see the moving avg line matches the ending values exactly.

The linear regression can act differently than a normal moving average. A normal moving average would increase in the area that reference, but this price action is causing the regression to act differently.

Chart: http://www.sierrachart.com/image.php?l=144885557073.png
[2015-11-30 04:14:55]
umair1 - Posts: 86
You are right. I did not calculate that properly at all. Thanks.

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

Login

Login Page - Create Account