| Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 2/9/2011 Posts: 76
|
Hi,
Is there a better or simpler way to create this PCF?
It calculates the (high-low) for each day and finds the average for the last 260 days and then it divides the rsult by the 5-day simple moving average applied to the closing price -
Please advise. See formular below;
((H1-L1)+(H2-L2)+(H3-L3)+(H4-L4)+(H5-L5)+(H6-L6)+(H7-L7)+(H8-L8)+(H9-L9)+(H10-L10)+(H11-L11)+(H12-L12)+(H13-L13)+(H14-L14)+(H15-L15)+(H16-L16)+(H17-L17)+(H18-L18)+(H19-L19)+(H20-L20)+(H21-L21)+(H22-L22)+(H23-L23)+(H24-L24)+(H25-L25)+(H26-L26)+(H27-L27)+(H28-L28)+(H29-L29)+(H30-L30)+(H31-L31)+(H32-L32)+(H33-L33)+(H34-L34)+(H35-L35)+(H36-L36)+(H37-L37)+(H38-L38)+(H39-L39)+(H40-L40)+(H41-L41)+(H42-L42)+(H43-L43)+(H44-L44)+(H45-L45)+(H46-L46)+(H47-L47)+(H48-L48)+(H49-L49)+(H50-L50)+(H51-L51)+(H52-L52)+(H53-L53)+(H54-L54)+(H55-L55)+(H56-L56)+(H57-L57)+(H58-L58)+(H59-L59)+(H60-L60)+(H61-L61)+(H62-L62)+(H63-L63)+(H64-L64)+(H65-L65)+(H66-L66)+(H67-L67)+(H68-L68)+(H69-L69)+(H70-L70)+(H71-L71)+(H72-L72)+(H73-L73)+(H74-L74)+(H75-L75)+(H76-L76)+(H77-L77)+(H78-L78)+(H79-L79)+(H80-L80)+(H81-L81)+(H82-L82)+(H83-L83)+(H84-L84)+(H85-L85)+(H86-L86)+(H87-L87)+(H88-L88)+(H89-L89)+(H90-L90)+(H91-L91)+(H92-L92)+(H93-L93)+(H94-L94)+(H95-L95)+(H96-L96)+(H97-L97)+(H98-L98)+(H99-L99)+(H100-L100)+(H101-L101)+(H102-L102)+(H103-L103)+(H104-L104)+(H105-L105)+(H106-L106)+(H107-L107)+(H108-L108)+(H109-L109)+(H110-L110)+(H111-L111)+(H112-L112)+(H113-L113)+(H114-L114)+(H115-L115)+(H116-L116)+(H117-L117)+(H118-L118)+(H119-L119)+(H120-L120)+(H121-L121)+(H122-L122)+(H123-L123)+(H124-L124)+(H125-L125)+(H126-L126)+(H127-L127)+(H128-L128)+(H129-L129)+(H130-L130)+(H131-L131)+(H132-L132)+(H133-L133)+(H134-L134)+(H135-L135)+(H136-L136)+(H137-L137)+(H138-L138)+(H139-L139)+(H140-L140)+(H141-L141)+(H142-L142)+(H143-L143)+(H144-L144)+(H145-L145)+(H146-L146)+(H147-L147)+(H148-L148)+(H149-L149)+(H150-L150)+(H151-L151)+(H152-L152)+(H153-L153)+(H154-L154)+(H155-L155)+(H156-L156)+(H157-L157)+(H158-L158)+(H159-L159)+(H160-L160)+(H161-L161)+(H162-L162)+(H163-L163)+(H164-L164)+(H165-L165)+(H166-L166)+(H167-L167)+(H168-L168)+(H169-L169)+(H170-L170)+(H171-L171)+(H172-L172)+(H173-L173)+(H174-L174)+(H175-L175)+(H176-L176)+(H177-L177)+(H178-L178)+(H179-L179)+(H180-L180)+(H181-L181)+(H182-L182)+(H183-L183)+(H184-L184)+(H185-L185)+(H186-L186)+(H187-L187)+(H188-L188)+(H189-L189)+(H190-L190)+(H191-L191)+(H192-L192)+(H193-L193)+(H194-L194)+(H195-L195)+(H196-L196)+(H197-L197)+(H198-L198)+(H199-L199)+(H200-L200)+(H201-L201)+(H202-L202)+(H203-L203)+(H204-L204)+(H205-L205)+(H206-L206)+(H207-L207)+(H208-L208)+(H209-L209)+(H210-L210)+(H211-L211)+(H212-L212)+(H213-L213)+(H214-L214)+(H215-L215)+(H216-L216)+(H217-L217)+(H218-L218)+(H219-L219)+(H220-L220)+(H221-L221)+(H222-L222)+(H223-L223)+(H224-L224)+(H225-L225)+(H226-L226)+(H227-L227)+(H228-L228)+(H229-L229)+(H230-L230)+(H231-L231)+(H232-L232)+(H233-L233)+(H234-L234)+(H235-L235)+(H236-L236)+(H237-L237)+(H238-L238)+(H239-L239)+(H240-L240)+(H241-L241)+(H242-L242)+(H243-L243)+(H244-L244)+(H245-L245)+(H246-L246)+(H247-L247)+(H248-L248)+(H249-L249)+(H250-L250)+(H251-L251)+(H252-L252)+(H253-L253)+(H254-L254)+(H255-L255)+(H256-L256)+(H257-L257)+(H258-L258)+(H259-L259)+(H260-L260))/(260*AVGC5)*100
|
|
 Administration
Joined: 9/30/2004 Posts: 9,187
|
(AVGH260 - AVGL260) / AVGC5 * 100
I think that's what you're looking for. The formula above is diving the numerator by 260*AVGC5, not 260.
|
|
Registered User Joined: 2/9/2011 Posts: 76
|
Thanks a lot sir.
That seems to work well.
How would I be able to then calculate the average true range of a stock over a 260 day period...?
tried something like this - but it failed.... (AVGH260-AVGL260)/260
My original scribbled calculation was;
((H1-L1)+(H2-L2)+(H3-L3)+(H4-L4)+(H5-L5)+(H6-L6)+(H7-L7)+(H8-L8)+(H9-L9)+(H10-L10)+(H11-L11)+(H12-L12)+(H13-L13)+(H14-L14)+(H15-L15)+(H16-L16)+(H17-L17)+(H18-L18)+(H19-L19)+(H20-L20)+(H21-L21)+(H22-L22)+(H23-L23)+(H24-L24)+(H25-L25)+(H26-L26)+(H27-L27)+(H28-L28)+(H29-L29)+(H30-L30)+(H31-L31)+(H32-L32)+(H33-L33)+(H34-L34)+(H35-L35)+(H36-L36)+(H37-L37)+(H38-L38)+(H39-L39)+(H40-L40)+(H41-L41)+(H42-L42)+(H43-L43)+(H44-L44)+(H45-L45)+(H46-L46)+(H47-L47)+(H48-L48)+(H49-L49)+(H50-L50)+(H51-L51)+(H52-L52)+(H53-L53)+(H54-L54)+(H55-L55)+(H56-L56)+(H57-L57)+(H58-L58)+(H59-L59)+(H60-L60)+(H61-L61)+(H62-L62)+(H63-L63)+(H64-L64)+(H65-L65)+(H66-L66)+(H67-L67)+(H68-L68)+(H69-L69)+(H70-L70)+(H71-L71)+(H72-L72)+(H73-L73)+(H74-L74)+(H75-L75)+(H76-L76)+(H77-L77)+(H78-L78)+(H79-L79)+(H80-L80)+(H81-L81)+(H82-L82)+(H83-L83)+(H84-L84)+(H85-L85)+(H86-L86)+(H87-L87)+(H88-L88)+(H89-L89)+(H90-L90)+(H91-L91)+(H92-L92)+(H93-L93)+(H94-L94)+(H95-L95)+(H96-L96)+(H97-L97)+(H98-L98)+(H99-L99)+(H100-L100)+(H101-L101)+(H102-L102)+(H103-L103)+(H104-L104)+(H105-L105)+(H106-L106)+(H107-L107)+(H108-L108)+(H109-L109)+(H110-L110)+(H111-L111)+(H112-L112)+(H113-L113)+(H114-L114)+(H115-L115)+(H116-L116)+(H117-L117)+(H118-L118)+(H119-L119)+(H120-L120)+(H121-L121)+(H122-L122)+(H123-L123)+(H124-L124)+(H125-L125)+(H126-L126)+(H127-L127)+(H128-L128)+(H129-L129)+(H130-L130)+(H131-L131)+(H132-L132)+(H133-L133)+(H134-L134)+(H135-L135)+(H136-L136)+(H137-L137)+(H138-L138)+(H139-L139)+(H140-L140)+(H141-L141)+(H142-L142)+(H143-L143)+(H144-L144)+(H145-L145)+(H146-L146)+(H147-L147)+(H148-L148)+(H149-L149)+(H150-L150)+(H151-L151)+(H152-L152)+(H153-L153)+(H154-L154)+(H155-L155)+(H156-L156)+(H157-L157)+(H158-L158)+(H159-L159)+(H160-L160)+(H161-L161)+(H162-L162)+(H163-L163)+(H164-L164)+(H165-L165)+(H166-L166)+(H167-L167)+(H168-L168)+(H169-L169)+(H170-L170)+(H171-L171)+(H172-L172)+(H173-L173)+(H174-L174)+(H175-L175)+(H176-L176)+(H177-L177)+(H178-L178)+(H179-L179)+(H180-L180)+(H181-L181)+(H182-L182)+(H183-L183)+(H184-L184)+(H185-L185)+(H186-L186)+(H187-L187)+(H188-L188)+(H189-L189)+(H190-L190)+(H191-L191)+(H192-L192)+(H193-L193)+(H194-L194)+(H195-L195)+(H196-L196)+(H197-L197)+(H198-L198)+(H199-L199)+(H200-L200)+(H201-L201)+(H202-L202)+(H203-L203)+(H204-L204)+(H205-L205)+(H206-L206)+(H207-L207)+(H208-L208)+(H209-L209)+(H210-L210)+(H211-L211)+(H212-L212)+(H213-L213)+(H214-L214)+(H215-L215)+(H216-L216)+(H217-L217)+(H218-L218)+(H219-L219)+(H220-L220)+(H221-L221)+(H222-L222)+(H223-L223)+(H224-L224)+(H225-L225)+(H226-L226)+(H227-L227)+(H228-L228)+(H229-L229)+(H230-L230)+(H231-L231)+(H232-L232)+(H233-L233)+(H234-L234)+(H235-L235)+(H236-L236)+(H237-L237)+(H238-L238)+(H239-L239)+(H240-L240)+(H241-L241)+(H242-L242)+(H243-L243)+(H244-L244)+(H245-L245)+(H246-L246)+(H247-L247)+(H248-L248)+(H249-L249)+(H250-L250)+(H251-L251)+(H252-L252)+(H253-L253)+(H254-L254)+(H255-L255)+(H256-L256)+(H257-L257)+(H258-L258)+(H259-L259)+(H260-L260))/260
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
A plain old 260-period average range formula (not Average True Range) could be written as:
AVGH260 - AVGL260
There is no reason for the / 260 at the end. Average True Range includes the previous close in the calculations of the range of each bar as well. The resulting formula is too long and slow to be practical or post in the forums.
What you can do in TC2000 version 12.3 is add the Average True Range indicator to the chart and set the period to 260. You can then click on it and select Show Values in in WatchList or Create Scan Condition to use the ATR value.
Sorting with Indicators
Create Condition from Your Chart
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 2/9/2011 Posts: 76
|
Hey Bruce - you just saved me a lot of time and stuff. Nice -
Quick one. I created an indicator that has this formular;
SGN(C - AVGO3) + SGN(C - AVGL3)
and it generates values from -2 to +2 (in a histogram format on my chart).
However I want to be able to add the results of this values generated (irrespective of the time frame I choose and get a summed up value as the day unfolds)....
So lets say on an hourly or 5mins chart - it generated a value of +2, +0.67, +1, -0.67 etc; it sums it up and gives a total value and I want to be able to have that on my watch list.
Can that be done?
If so, what's the formular?
Thanks
Stanley
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
It is possible to get a summed value over time by creating a Custom PCF Cumulative Indicator. You would set the Up Condition to something that is always true such as C > C - 1, the Down Condition to something that is always false such as C < C - 1 and use your formula as the Value to Add/Subtract.
That said, it is cumulative over the entire history of the symbol. There is no way for a user to create an indicator of this type that resets at the beginning of each day.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 2/9/2011 Posts: 76
|
Hi,
I have a concern and want to be able to create a formular or something that helps me COUNT.
I have a histogram bar (indicator) with a certain formula - that has a range of between -2 and +2; I would love to be able to use the COUNT instruction to say something like, COUNT how many times the bar touches "2" (or whatver number I choose), within a certain time frame of number of bars....
For instance, COUNT how many times the bar records a value between 1.3 and 2 over the last 150 bars on the 5min
Something like that -
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
There is no count syntax built into the Personal Criteria Formula Language. That said, it is possible to count using PCFs.
For example, you could create an Indicator Formula to count the number of times price increased during the most recent 10-bars as:
ABS(C > C1) - (C1 > C2) - (C2 > C3) - (C3 > C4) - (C4 > C5) - (C5 > C6) - (C6 > C7) - (C7 > C8) - (C8 > C9) - (C9 > C10)
If you are willing to settle for a percentage, and your "certain formula" can be easily expressed as a formula, then you could create a Condition Formula for you certain formula to be >= 1.3 as a Custom PCF % True Indicator. If you set the Period to 150 and the Average Type to Simple, the result will be the percentage of the time during the most recent 150-bars that the Boolean Formula returned true.
That said, I have no idea if it will work for your particular purpose as you did not outline the "certain formula" of interest.
PCF Formula Descriptions
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 2/9/2011 Posts: 76
|
Hey Bruce. Thanks a lot for the help with the response yesterday. It really helped. I would send you the formula, so you can look at it.
In the meantime - there is a feature that used be on Stockfinder - what i does is - if I have a formula or a condition that passes as true, it paints an arrow or something like that at the very bar where the condition was true. So it is almost like it gives me or marks the different points across the trading time frame where the condition or formula was true.
Can I have that feature on TC2000? Can a PCF be written to that effect.
e.g; C > C1 ( I want to have an arrow or a paint or something that shows everytime thats true on the chart)
Regards
Stan
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You can create spikes on the chart in TC2000 just by using your Condition Formula as the Boolean Formula in a Custom PCF % True Indicator with the Period set to 1. The Custom PCF % True Indicator will return 100 when the Boolean Formula is true and 0 when the Boolean Formula is false.
Another option is to use a Custom PCF Indicator instead of a Custom PCF % True Indicator. While this will not create arrows, it would allow you to plot dots at price instead of having spikes on the chart.
It is a bit more complicated however as you need to create an Indicator Formula based on the Condition Formula which determines the price at which to plot the dots. For example, the following settings would plots dots at price when the Custom PCF Indicator is scaled with price.
- Plot Style: Dots
- Period: 1
- Average Type: Doesn't matter (because the Period is 1)
- Formula: C * ABS(C > C1)
Adding and Moving Indicators
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
|
Guest-1 |