Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 10/15/2005 Posts: 4
|
Hi!
Is there a way to automatically draw a horizontal line from, let's say, the second highest-high in the past N days. I tried to come up with a formula for a custom indicator, but could not.
For example, something like this?
*----------------- * * * * * * * * *
Thank you, Dmitry
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 18,819
|
I don't know of a way to identify the second highest-high with the formula language.
- Craig Here to Help!
|
|
Registered User Joined: 10/15/2005 Posts: 4
|
The price graph didn't quite come out the way I want -- let me try it with preserving HTML:
*----------------- * * * * * * * * *
|
|
Registered User Joined: 10/15/2005 Posts: 4
|
alright, thank you
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 18,819
|
I understand what you're asking for.
- Craig Here to Help!
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 18,819
|
...thinking about it more, I do know a way it could be identified. Depending on the number of highs being considered, it could easily become a formula that would screech your TeleChart to a hault.
I don't know a way to create an automatic straight line once we identify the second-highest high.
Your best bet is to eye-ball it and use the straight-line drawing tool (hit your D key on the keyboard and hold the SHIFT key as you draw the trendline.)
- Craig Here to Help!
|
|
Registered User Joined: 1/1/2005 Posts: 2,645
|
Dmitry,
Part of what you are asking falls under the heading of Order Statistics,i.e., first largest, second largest, third largest, etc. Please see:
PCF for Order Statistics
The PCFs can get quite long fast.
Thanks, Jim Murphy
|
|
Registered User Joined: 1/1/2005 Posts: 2,645
|
Bruce,
Do you feel up to supplying a PCF for the second highest high in 30 days? It is beyond my endurance.
Of course, that is different from the second previous 30 day high that appears in the title which can also be done.
Thanks, Jim Murphy
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 18,819
|
Even if the monster PCF is written, we still cannot automatically draw a horizontal line at that point.
- Craig Here to Help!
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
bustermu, Is this the formula you wanted me to post?
Second highest high for the last 30 days:
( - 1) * ((H = MAXH30) * MAXH29.1 - (H < MAXH30) * ((H1 = MAXH30) * (MAXH1 + MAXH28.2 + ABS(MAXH1 - MAXH28.2)) / 2 - (H1 < MAXH30) * ((H2 = MAXH30) * (MAXH2 + MAXH27.3 + ABS(MAXH2 - MAXH27.3)) / 2 - (H2 < MAXH30) * ((H3 = MAXH30) * (MAXH3 + MAXH26.4 + ABS(MAXH3 - MAXH26.4)) / 2 - (H3 < MAXH30) * ((H4 = MAXH30) * (MAXH4 + MAXH25.5 + ABS(MAXH4 - MAXH25.5)) / 2 - (H4 < MAXH30) * ((H5 = MAXH30) * (MAXH5 + MAXH24.6 + ABS(MAXH5 - MAXH24.6)) / 2 - (H5 < MAXH30) * ((H6 = MAXH30) * (MAXH6 + MAXH23.7 + ABS(MAXH6 - MAXH23.7)) / 2 - (H6 < MAXH30) * ((H7 = MAXH30) * (MAXH7 + MAXH22.8 + ABS(MAXH7 - MAXH22.8)) / 2 - (H7 < MAXH30) * ((H8 = MAXH30) * (MAXH8 + MAXH21.9 + ABS(MAXH8 - MAXH21.9)) / 2 - (H8 < MAXH30) * ((H9 = MAXH30) * (MAXH9 + MAXH20.10 + ABS(MAXH9 - MAXH20.10)) / 2 - (H9 < MAXH30) * ((H10 = MAXH30) * (MAXH10 + MAXH19.11 + ABS(MAXH10 - MAXH19.11)) / 2 - (H10 < MAXH30) * ((H11 = MAXH30) * (MAXH11 + MAXH18.12 + ABS(MAXH11 - MAXH18.12)) / 2 - (H11 < MAXH30) * ((H12 = MAXH30) * (MAXH12 + MAXH17.13 + ABS(MAXH12 - MAXH17.13)) / 2 - (H12 < MAXH30) * ((H13 = MAXH30) * (MAXH13 + MAXH16.14 + ABS(MAXH13 - MAXH16.14)) / 2 - (H13 < MAXH30) * ((H14 = MAXH30) * (MAXH14 + MAXH15.15 + ABS(MAXH14 - MAXH15.15)) / 2 - (H14 < MAXH30) * ((H15 = MAXH30) * (MAXH15 + MAXH14.16 + ABS(MAXH15 - MAXH14.16)) / 2 - (H15 < MAXH30) * ((H16 = MAXH30) * (MAXH16 + MAXH13.17 + ABS(MAXH16 - MAXH13.17)) / 2 - (H16 < MAXH30) * ((H17 = MAXH30) * (MAXH17 + MAXH12.18 + ABS(MAXH17 - MAXH12.18)) / 2 - (H17 < MAXH30) * ((H18 = MAXH30) * (MAXH18 + MAXH11.19 + ABS(MAXH18 - MAXH11.19)) / 2 - (H18 < MAXH30) * ((H19 = MAXH30) * (MAXH19 + MAXH10.20 + ABS(MAXH19 - MAXH10.20)) / 2 - (H19 < MAXH30) * ((H20 = MAXH30) * (MAXH20 + MAXH9.21 + ABS(MAXH20 - MAXH9.21)) / 2 - (H20 < MAXH30) * ((H21 = MAXH30) * (MAXH21 + MAXH8.22 + ABS(MAXH21 - MAXH8.22)) / 2 - (H21 < MAXH30) * ((H22 = MAXH30) * (MAXH22 + MAXH7.23 + ABS(MAXH22 - MAXH7.23)) / 2 - (H22 < MAXH30) * ((H23 = MAXH30) * (MAXH23 + MAXH6.24 + ABS(MAXH23 - MAXH6.24)) / 2 - (H23 < MAXH30) * ((H24 = MAXH30) * (MAXH24 + MAXH5.25 + ABS(MAXH24 - MAXH5.25)) / 2 - (H24 < MAXH30) * ((H25 = MAXH30) * (MAXH25 + MAXH4.26 + ABS(MAXH25 - MAXH4.26)) / 2 - (H25 < MAXH30) * ((H26 = MAXH30) * (MAXH26 + MAXH3.27 + ABS(MAXH26 - MAXH3.27)) / 2 - (H26 < MAXH30) * ((H27 = MAXH30) * (MAXH27 + MAXH2.28 + ABS(MAXH27 - MAXH2.28)) / 2 - (H27 < MAXH30) * ((H28 = MAXH30) * (MAXH28 + MAXH1.29 + ABS(MAXH28 - MAXH1.29)) / 2 - (H28 < MAXH30) * ((H29 = MAXH30) * MAXH29))))))))))))))))))))))))))))))
I can't think of a way to draw a horizontal line from that point in TeleChart either, but a Custom Indicator w/Plot using price scale checked could still provide a guide for eyeball use. The following free online training video could be helpful for anybody wishing to set up such an indicator:
Plotting Custom Indicators with Examples
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 1/1/2005 Posts: 2,645
|
Craig,
It may be a "monster" to you and I for a period of 30 bars, but Bruce continually provides PCFs longer than required here.
Once a PCF is available, the horizontal line of the pointer can be placed on the value manually. That is likely a lot easier than searching for the second highest high over some 30 bar interval visually.
Thanks, Jim Murphy
|
|
Guest-1 |