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

Moving Linear Regression scan crossing Price Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
hans2005
Posted : Saturday, February 8, 2014 8:59:15 PM
Registered User
Joined: 11/17/2010
Posts: 14

Hello,

 

I am trying to create a scan on Moving Linear Regression crossing down / up price line. I does not show any results

Bruce_L
Posted : Wednesday, February 12, 2014 10:17:15 AM


Worden Trainer

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

Thank you for reporting the issue. I have submitted your bug report to development.

I can probably create a Condition Formula to get around the issue if you provide the settings of the Moving Linear Regression indicator.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
hans2005
Posted : Wednesday, February 12, 2014 9:00:16 PM
Registered User
Joined: 11/17/2010
Posts: 14

Thanks Bruce,

Yes, I would like to one created.

 

Thanks

 

Bruce_L
Posted : Thursday, February 13, 2014 1:01:38 PM


Worden Trainer

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

I would need to know the settings of the Moving Linear Regression indicator to help you create the Condition Formula.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
hans2005
Posted : Thursday, February 13, 2014 9:17:41 PM
Registered User
Joined: 11/17/2010
Posts: 14

I would like 13 day period.

Bruce_L
Posted : Friday, February 14, 2014 11:44:23 AM


Worden Trainer

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

A Condition Formula for price crossing up through its own 13-period moving linear regression can be written as:

C > AVGC13 + 6 * (6 * C + 5 * C1 + 4 * C2 + 3 * C3 + 2 * C4 + C5 - C7 - 2 * C8 - 3 * C9 - 4 * C10 - 5 * C11 - 6 * C12) / 182 AND C1 <= AVGC13.1 + 6 * (6 * C1 + 5 * C2 + 4 * C3 + 3 * C4 + 2 * C5 + C6 - C8 - 2 * C9 - 3 * C10 - 4 * C11 - 5 * C12 - 6 * C13) / 182

A Condition Formula for price crossing down through its own 13-period moving linear regression can be written as:

C < AVGC13 + 6 * (6 * C + 5 * C1 + 4 * C2 + 3 * C3 + 2 * C4 + C5 - C7 - 2 * C8 - 3 * C9 - 4 * C10 - 5 * C11 - 6 * C12) / 182 AND C1 >= AVGC13.1 + 6 * (6 * C1 + 5 * C2 + 4 * C3 + 3 * C4 + 2 * C5 + C6 - C8 - 2 * C9 - 3 * C10 - 4 * C11 - 5 * C12 - 6 * C13) / 182

A Condition Formula for price crossing through its own 13-period moving linear regression in either direction can be written as:

SGN(AVGC13 + 6 * (6 * C + 5 * C1 + 4 * C2 + 3 * C3 + 2 * C4 + C5 - C7 - 2 * C8 - 3 * C9 - 4 * C10 - 5 * C11 - 6 * C12) / 182 - C) <> SGN(AVGC13.1 + 6 * (6 * C1 + 5 * C2 + 4 * C3 + 3 * C4 + 2 * C5 + C6 - C8 - 2 * C9 - 3 * C10 - 4 * C11 - 5 * C12 - 6 * C13) / 182 - C1)

Using Linear Regression vs Classical Peaks/Valleys for Divergence Analysis



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
hans2005
Posted : Saturday, February 15, 2014 10:36:38 PM
Registered User
Joined: 11/17/2010
Posts: 14

Thanks a lot Bruce.  Your help is very much appreciated.

 

 

hans2005
Posted : Tuesday, February 18, 2014 10:20:21 PM
Registered User
Joined: 11/17/2010
Posts: 14

Hi Bruce,

It doesn't work consistently.   I want the price moving down / up today. 

The current behavior is more or less as  MLR > price   or MLR < price

 
Bruce_L
Posted : Wednesday, February 19, 2014 8:21:35 AM


Worden Trainer

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

Please provide specific examples as it most definitely does not behave that way in my copy of TC2000.

The first formula only returns true when the close of the previous bar was at or below the moving linear regression and the close of the current bar is above the moving linear regression.

The second formula only returns true when the close of the previous bar was at or above the moving linear regression and the close of the current bar is below the moving linear regression.

The third formula only returns true when the close of the previous bar was on one side of the moving linear regression and the close of the current bar is on the other side of the moving linear regression.

The cross always happens between the previous bar and the current bar. The formulas do not return true unless this is the case.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
hans2005
Posted : Wednesday, February 19, 2014 9:27:20 PM
Registered User
Joined: 11/17/2010
Posts: 14

Sorry Bruce,

 

I use only the  first two.  I now changed the chart to line intead of OLC which gives me better insight on crossing , especially in cases like FLS (for price moving up) and LMT (price moving down)

 

Thanks

 

Bruce_L
Posted : Thursday, February 20, 2014 10:26:08 AM


Worden Trainer

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

A cross is almost always defined as price closing on one side of the line during the previous bar and being on the other side of the line during the current bar.

If you have something else in mind which involves the open, high and low in addition to the close, you would need to provide the specifics on how you wish to define the cross.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
stochastics
Posted : Saturday, May 24, 2014 12:25:13 AM
Registered User
Joined: 3/3/2013
Posts: 57
Morning Bruce,
 
May I have a PCF for 10-period moving linear regression crossing it's own 2 moving avg. (offset +1) in either direction please. I tried the following but I cannot get it to work...
 
Thanks in advance!  
 
SGN(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  - AVGH2.1 - AVGL2.1 - AVGC2.1) <> SGN(AVGC10.1 + 4.5 * (4.5 * C1 + 3.5 * C2 + 2.5 * C32+ 1.5 * C4 + 0.5 * C5 - 0.5 * C6 - 1.5 * C7 - 2.5 * C8 - 3.5 * C9 - 4.5 * C10) / 82.5  - AVGH2.2 - AVGL2.2 - AVGC2.2)
Bruce_L
Posted : Tuesday, May 27, 2014 12:51:02 PM


Worden Trainer

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

Please try the following Condition Formula.

SGN(38 * C + 13 * (C1 + C10) + 8 * C11 - 72 * AVGC8.2) <> SGN(38 * C1 + 13 * (C2 + C11) + 8 * C12 - 72 * AVGC8.3)



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
stochastics
Posted : Tuesday, May 27, 2014 7:19:08 PM
Registered User
Joined: 3/3/2013
Posts: 57

TY It performs excellently!   I'd like to also add a PCF that shows MLR10 > (its own) AVGC2 (offset +1) please.  

Bruce_L
Posted : Wednesday, May 28, 2014 9:41:03 AM


Worden Trainer

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

Please try the following Condition Formula:

38 * C + 13 * (C1 + C10) + 8 * C11 > 72 * AVGC8.2



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
HHA
Posted : Thursday, February 2, 2017 5:35:34 PM
Registered User
Joined: 8/10/2014
Posts: 10

Hello Bruce,

I am having exactly the same issue. I'm trying to scan for a crossing of the moving linear regression 10 and 30. But nothing is found. Visual inspection shows plenty of charts meeting the criteria. I''m using the settings as shown in the attached screenshot. Could you please have a look?

PS: I tried it with verion 16 and 17, both the same issue

usmansajid
Posted : Thursday, February 2, 2017 6:17:08 PM
Registered User
Joined: 3/17/2016
Posts: 48

I had the same issue in V16, it appears to be a bug.

Back in 2016, I was using Moving Linear Regression 16 periods crossing up 2 Period Simple Moving Average Linear Regression 16, it didnt work. It looks like its still not fixed.

Bruce_L
Posted : Friday, February 3, 2017 9:13:17 AM


Worden Trainer

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

A Condition Formula for the MLR10 of price crossing up through the MLR30 of price within the most recent 12 bars can be written as follows in TC2000 v17.

XUP(3 * FAVGC10 - 2 * AVGC10, 3 * FAVGC30 - 2 * AVGC30, 12) 



-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.