Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Moving Linear Regression Line Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
rickbw
Posted : Sunday, March 22, 2015 6:14:40 PM
Registered User
Joined: 10/10/2004
Posts: 30

Is there a way to write a PCF that would look for where a moving linear regression line is on a chart?  i.e. LR10 below Bollinger Band bottom (30,2)

Bruce_L
Posted : Monday, March 23, 2015 1:22:30 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

The best way to do this is to click on the Moving Linear Regression indicator and select Create Scan Condition.

Create Conditions from Your Chart (5:25)

As far as writing a formula goes, if the Bollinger Band is of the Linear Regression, then probably not. If the Bollinger Band and Linear Regression are both of price however, then yes.

Using Linear Regression vs Classical Peaks/Valleys for Divergence Analysis
Modelling Bollinger Bands (& Standard Deviation) in a TC PCF

AVGC10 + 4.5 * (4.5 * C + 3.5 * C1 + 2.5 * C2 + 1.5 * C3 + .5 * C4 - .5 * C5 - 1.5 * C6 - 2.5 * C7 - 3.5 * C8 - 4.5 * C9) / 82.5 < AVGC30 - 2 * SQR(ABS(C ^ 2 + C1 ^ 2 + C2 ^ 2 + C3 ^ 2 + C4 ^ 2 + C5 ^ 2 + C6 ^ 2 + C7 ^ 2 + C8 ^ 2 + C9 ^ 2 + C10 ^ 2 + C11 ^ 2 + C12 ^ 2 + C13 ^ 2 + C14 ^ 2 + C15 ^ 2 + C16 ^ 2 + C17 ^ 2 + C18 ^ 2 + C19 ^ 2 + C20 ^ 2 + C21 ^ 2 + C22 ^ 2 + C23 ^ 2 + C24 ^ 2 + C25 ^ 2 + C26 ^ 2 + C27 ^ 2 + C28 ^ 2 + C29 ^ 2 - 30 * AVGC30 ^ 2) / 30)



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
rickbw
Posted : Monday, March 23, 2015 3:05:54 PM
Registered User
Joined: 10/10/2004
Posts: 30

Thanks, I'm learning all over again.   I didn't realize I could create a condition from the chart in TC200 also, so that's the way I accomplished it!

HHA
Posted : Thursday, March 24, 2016 6:57:43 AM
Registered User
Joined: 8/10/2014
Posts: 10

Dear Sir,

As I understood, the formula for a 10 bar moving linear regression line is:

AVGC10 + 4.5 * (4.5 * C + 3.5 * C1 + 2.5 * C2 + 1.5 * C3 + 0.5 * C4 - 0.5 * C5 - 1.5 * C6 - 2.5 * C7 - 3.5 * C8 - 4.5 * C9) / 82.5

However when plot on a chart, this formula results in a different output as the build in 'Moving Linear Regression' Indicator.

Could you please explain why this is? thx in advance

 

 

 

Bruce_L
Posted : Thursday, March 24, 2016 8:51:52 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

The formula matches and should line up, but there are several possibilities as to why it would not.

The most likely reason would be that the Custom PCF Indicator just isn't plotted in the same scale as price. If so, then you should be able to click on the Custom PCF Indicator and select Scaling. Then choose to Scale with price (probably listed as the symbol and company name) instead of By Itself.

Another possible reason would be that price is set to use Heiken-Ashi bars. If this is the case, then the Custom PCF Indicator will be using actual prices while the Moving Linear Regression indicator will be based on HA prices.

Yet another possibility would be the Moving Linear Regression indicator using something besides price as its data source (such as a moving average).

How to change the data source for an Indicator



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
HHA
Posted : Thursday, March 24, 2016 12:28:40 PM
Registered User
Joined: 8/10/2014
Posts: 10

Thx Bruce for your quick reply

I checked the settings, but both are using the 'Price History' as source.

I use the data window in de top left of the chart to compare the numeric values. And they are not the same.

The strange thing is, the value's are the same when both added to a watchlist column

Bruce_L
Posted : Thursday, March 24, 2016 12:46:51 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

I'm guessing the issue is actually the .s being used in the formula as decimal markers instead of using ,s as decimal markers. Please try the following Indicator which avoids the use of decimal markers entirely instead.

AVGC10 + 3 * (9 * (C - C9) + 7 * (C1 - C8) + 5 * (C2 - C7) + 3 * (C3 - C6) + C4 - C5) / 110



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
HHA
Posted : Thursday, March 24, 2016 1:55:52 PM
Registered User
Joined: 8/10/2014
Posts: 10

That's it! Thanks a lot

Bruce_L
Posted : Thursday, March 24, 2016 2:03:20 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

You're welcome.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.