Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 10/31/2008 Posts: 69
|
Hi Bruce. Is it possible to set up a moving linear regression channel indicator using the custom pcf channel feature? If so would you provide the formulas for 19 days and 1.5 std deviations and 2.0 deviations?
Thanks, Grant
|
|
Administration
Joined: 9/30/2004 Posts: 9,187
|
I don't know how to write a PCF for that, but if you plot a Moving Linear Regression line, you can add Envelope Channels to that plot to get the indicators you're looking for.
|
|
Registered User Joined: 10/31/2008 Posts: 69
|
Thanks StockGuy, I tried that after posting the query and this seemed to work out to a similar reading on some symbols and then not on others due to using a percentage rather than deviation I suppose. Is there a solution to this problem?
Thanks, Grant
|
|
Administration
Joined: 9/30/2004 Posts: 9,187
|
For standard deviation, try plotting Bollinger Bands instead of Envelope Channels.
|
|
Registered User Joined: 10/31/2008 Posts: 69
|
Hi again Stockguy, The BBands also are posing the same problem as Envelope Channels by not giving a consistent reading acroos different symbols as compared to the Regression Channel drawing tool. I used a setting of one period and eyeballed the deviation to match the Regression Channel. Once I changed the symbol they no longer matched. Is there a correction I could make?
Thanks, Grant
|
|
Administration
Joined: 9/30/2004 Posts: 9,187
|
I'm not sure how else to approach it at this point.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The 19 period moving linear regression line can be written as follows.
AVGC19 + 9 * (9 * C + 8 * C1 + 7 * C2 + 6 * C3 + 5 * C4 + 4 * C5 + 3 * C6 + 2 * C7 + C8 - C10 - 2 * C11 - 3 * C12 - 4 * C13 - 5 * C14 - 6 * C15 - 7 * C16 - 8 * C17 - 9 * C18) / 570
1.5 standard deviations above this can be written as follows.
AVGC19 + 9 * (9 * C + 8 * C1 + 7 * C2 + 6 * C3 + 5 * C4 + 4 * C5 + 3 * C6 + 2 * C7 + C8 - C10 - 2 * C11 - 3 * C12 - 4 * C13 - 5 * C14 - 6 * C15 - 7 * C16 - 8 * C17 - 9 * C18) / 570 + 1.5 * 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 - 19 * AVGC19 ^ 2) / 19)
1.5 standard deviations below this can be written as follows.
AVGC19 + 9 * (9 * C + 8 * C1 + 7 * C2 + 6 * C3 + 5 * C4 + 4 * C5 + 3 * C6 + 2 * C7 + C8 - C10 - 2 * C11 - 3 * C12 - 4 * C13 - 5 * C14 - 6 * C15 - 7 * C16 - 8 * C17 - 9 * C18) / 570 - 1.5 * 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 - 19 * AVGC19 ^ 2) / 19)
2 standard deviations above this can be written as follows.
AVGC19 + 9 * (9 * C + 8 * C1 + 7 * C2 + 6 * C3 + 5 * C4 + 4 * C5 + 3 * C6 + 2 * C7 + C8 - C10 - 2 * C11 - 3 * C12 - 4 * C13 - 5 * C14 - 6 * C15 - 7 * C16 - 8 * C17 - 9 * C18) / 570 - 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 - 19 * AVGC19 ^ 2) / 19)
2 standard deviations below this can be written as follows
AVGC19 + 9 * (9 * C + 8 * C1 + 7 * C2 + 6 * C3 + 5 * C4 + 4 * C5 + 3 * C6 + 2 * C7 + C8 - C10 - 2 * C11 - 3 * C12 - 4 * C13 - 5 * C14 - 6 * C15 - 7 * C16 - 8 * C17 - 9 * C18) / 570 +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 - 19 * AVGC19 ^ 2) / 19)
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 6/14/2016 Posts: 285
|
Hi Bruce,
I would also like to be able to plot a custom PCF indicator for linear regression channels and then to use it in a scan.
What I have been using in Ninja thusfar is a 55 period linear regression line and upeer/lower channels having 3 StDev's.
I notivced the formulas for a 19 period +- 2 StDev channel above. I would appreciate it if you could adapt the code to a 55 period LR Line using +-3 StDev channels.
Presumably, once I plot this, I could right click and save it as scan crietria?
Thanks a lot. Kind regards,
Chris
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The 55 period moving linear regression can be written as follows.
AVGC55 + 27 * (27 * (C - C54) + 26 * (C1 - C53) + 25 * (C2 - C52) + 24 * (C3 - C51) + 23 * (C4 - C50) + 22 * (C5 - C49) + 21 * (C6 - C48) + 20 * (C7 - C47) + 19 * (C8 - C46) + 18 * (C9 - C45) + 17 * (C10 - C44) + 16 * (C11 - C43) + 15 * (C12 - C42) + 14 * (C13 - C41) + 13 * (C14 - C40) + 12 * (C15 - C39) + 11 * (C16 - C38) + 10 * (C17 - C37) + 9 * (C18 - C36) + 8 * (C19 - C35) + 7 * (C20 - C34) + 6 * (C21 - C33) + 5 * (C22 - C32) + 4 * (C23 - C31) + 3 * (C24 - C30) + 2 * (C25 - C29) + C26 - C28) / 13860
3 standard deviations above this can be written as follows.
AVGC55 + 27 * (27 * (C - C54) + 26 * (C1 - C53) + 25 * (C2 - C52) + 24 * (C3 - C51) + 23 * (C4 - C50) + 22 * (C5 - C49) + 21 * (C6 - C48) + 20 * (C7 - C47) + 19 * (C8 - C46) + 18 * (C9 - C45) + 17 * (C10 - C44) + 16 * (C11 - C43) + 15 * (C12 - C42) + 14 * (C13 - C41) + 13 * (C14 - C40) + 12 * (C15 - C39) + 11 * (C16 - C38) + 10 * (C17 - C37) + 9 * (C18 - C36) + 8 * (C19 - C35) + 7 * (C20 - C34) + 6 * (C21 - C33) + 5 * (C22 - C32) + 4 * (C23 - C31) + 3 * (C24 - C30) + 2 * (C25 - C29) + C26 - C28) / 13860 + 3 * 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 + C30 ^ 2 + C31 ^ 2 + C32 ^ 2 + C33 ^ 2 + C34 ^ 2 + C35 ^ 2 + C36 ^ 2 + C37 ^ 2 + C38 ^ 2 + C39 ^ 2 + C40 ^ 2 + C41 ^ 2 + C42 ^ 2 + C43 ^ 2 + C44 ^ 2 + C45 ^ 2 + C46 ^ 2 + C47 ^ 2 + C48 ^ 2 + C49 ^ 2 + C50 ^ 2 + C51 ^ 2 + C52 ^ 2 + C53 ^ 2 + C54 ^ 2 - 55 * AVGC55 ^ 2) / 55)
3 standard deviations below this can be written as follows.
AVGC55 + 27 * (27 * (C - C54) + 26 * (C1 - C53) + 25 * (C2 - C52) + 24 * (C3 - C51) + 23 * (C4 - C50) + 22 * (C5 - C49) + 21 * (C6 - C48) + 20 * (C7 - C47) + 19 * (C8 - C46) + 18 * (C9 - C45) + 17 * (C10 - C44) + 16 * (C11 - C43) + 15 * (C12 - C42) + 14 * (C13 - C41) + 13 * (C14 - C40) + 12 * (C15 - C39) + 11 * (C16 - C38) + 10 * (C17 - C37) + 9 * (C18 - C36) + 8 * (C19 - C35) + 7 * (C20 - C34) + 6 * (C21 - C33) + 5 * (C22 - C32) + 4 * (C23 - C31) + 3 * (C24 - C30) + 2 * (C25 - C29) + C26 - C28) / 13860 - 3 * 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 + C30 ^ 2 + C31 ^ 2 + C32 ^ 2 + C33 ^ 2 + C34 ^ 2 + C35 ^ 2 + C36 ^ 2 + C37 ^ 2 + C38 ^ 2 + C39 ^ 2 + C40 ^ 2 + C41 ^ 2 + C42 ^ 2 + C43 ^ 2 + C44 ^ 2 + C45 ^ 2 + C46 ^ 2 + C47 ^ 2 + C48 ^ 2 + C49 ^ 2 + C50 ^ 2 + C51 ^ 2 + C52 ^ 2 + C53 ^ 2 + C54 ^ 2 - 55 * AVGC55 ^ 2) / 55)
You would plot these values as Custom PCF Indicators in the same pane and scale as price. Then you could click on price or the indicators and select Create Scan Condition to create any conditions.
How to add an indicator to a chart template
Create Conditions from Your Chart (5:25)
How to Create an EasyScan and save it to the Library
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 6/14/2016 Posts: 285
|
Many thanks, Bruce - much appreciated.
Chris
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |