Registered User Joined: 4/3/2012 Posts: 56
|
Hi Bruce,
I have come across the following post about swing pints Highs and Lows
http://forums.worden.com/default.aspx?g=posts&t=57592
A lot of time has passed and I was wondering if now you have a solution for this is possible now on TC2000 V17
Basically a high (Swing Point High) that has not been broken for 5 bars or more and that it takes place 5 bars or more after the previous Swing Point High
Thanks
Kind regards
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The formula to identify such a swing high would be the following in TC2000 v17 (pretty much the same as in v7).
MAXH5 < H5 AND H5 > MAXH5.6
It would be identified 5 bars after the swing high.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 4/3/2012 Posts: 56
|
http://s346.photobucket.com/user/Currupipi8888/media/Captura_zpsblbvjwy7.png.html?o=0
Btuce if you see in the link or picture i do not know if is going to upload you can see that the formula you provided is not working properly, the rounded area you can count 5 bars and then it makes a high (please see arrow of the bar of the high) but does not signaled when 5 bars have gone by already and is the highest bar for the next consecutive 5 bars
Please help
|
|
Registered User Joined: 4/3/2012 Posts: 56
|
|
|
Registered User Joined: 4/3/2012 Posts: 56
|
I could post the picture¡¡¡¡
Please see what I mean on the previous post,
Just would like to mention that the triangle shapes is the result of the indicator and the blue bars are the indicator with a sma1 offset -5 so it matches the graph
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The swing high requires 5 bars after it in order for it to get counted. It doesn't look like enough bars have passed on the chart in order for the new swing high to be detected.
You could write a formula that doesn't wait for confirmation, but it will return true on a lot of bars that don't turn out to be new swing highs (just new highs in an uptrend).
H > MAXH5.1
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 4/3/2012 Posts: 56
|
no, that is not the case, sorry about that, it was the picture that I could upload
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
That high isn't higher than the five previous bars, so your swing high can't be a high surrounded by 5 lower highs on each side like I thought.
Do you want a swing high defined by only two lower highs on each side, but it must be at least 5 bars or more since the previous swing high?
MAXH2 < H2 AND H2 > MAXH2.3 AND CountTrue(MAXH2.3 < H5 AND H5 > MAXH2.6, 2) = 0
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 4/3/2012 Posts: 56
|
What I’m exactly looking for is
A swing high that is not break for 5 consecutive days and that 5 days pass between highs, the high can happen during an uptrend or down trend
The bars behind the swing high can be higher but at least 5 days has to pass between Swing Highs and the bar before the swing high is the only one that has to be lower than the swing high
Is this possible?
Please see chart below for more clarity
The blue arrows point to swing highs and the red ones to swing lows,
|
|
Registered User Joined: 4/3/2012 Posts: 56
|
|
|
Registered User Joined: 4/3/2012 Posts: 56
|
|
|
Administration
Joined: 9/30/2004 Posts: 9,187
|
What defines the second "high" in your illustration? It's only higher than the two bars before it.
|
|
Registered User Joined: 4/3/2012 Posts: 56
|
The high is defined as follows,
The previous bar is lower
The 5 days following are below the high of that bar
five 5 days have passed after the previous high
|
|
Registered User Joined: 4/3/2012 Posts: 56
|
5 days or more have to be between swing highs
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Higher than 1 bar prior and 5 bars after with this being the first time this has happened within 5 bars?
MAXH5 < H5 AND H5 > H6 AND CountTrue(MAXH5.2 < H7 AND H7 > H8, 5) = 0
Depending on how you are counting, that , 5 near the end could be a , 4 or ,6 instead, but I think the 5 is most likely what you want.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 4/3/2012 Posts: 56
|
The above formula is not detecting the second and fourth swing high
it does not matter if it happens for the first time, it can happen many times as long as after the high is not broken for 5 bars and the previous swing high happens 5 bars before or more
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Let's consider what gets marked when no check for at least 5 bars between the swings.
MAXH5 < H5 AND H5 > H6
You can get the fourth swing high (6/14/17) marked by changing that ,5 I mentioned previously to a , 4 instead.
MAXH5 < H5 AND H5 > H6 AND CountTrue(MAXH5.2 < H7 AND H7 > H8, 4) = 0
But your second swing high (5/22/17) doesn't get counted even with the first shorter formula because it isn't higher (only equal to), the following 5 bars. We can mark it using the following.
MAXH5 <= H5 AND H5 > H6
But, if we then try to modify it to check for at least 5 bars between the swings.
MAXH5 <= H5 AND H5 > H6 AND CountTrue(MAXH5.2 <= H7 AND H7 > H8, 4) = 0
It doesn't work because 5/17/17 would have met the requirements if it wasn't for the fact that 5/12/17 met the requirements. So it sees the 5/17/17 as a swing high within the previous 5 days and doesn't mark 5/22/17 as a result.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 4/3/2012 Posts: 56
|
I see now what you mean when using the formula
MAXH5 <= H5 AND H5 > H6 AND CountTrue(MAXH5.2 <= H7 AND H7 > H8, 4) = 0
Is there a way to solve that? the formula as you say does not work because 5/17/17 meets all the requirements except that no 5 days have gone bye from the previous high
Would it be possible to start counting after 5 days from the last High and avoid that problem?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I can't think of a way to do so if 5 bars between highs is included as part of the definition of where you start counting in any sort of way which would be practical to code using the Personal Criteria Formula Language.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 4/3/2012 Posts: 56
|
What about creating two formulas and then combine them in a visual form on the graph so we know when both things take place.
one formula would be that 5 days have gone bye
and the second formula displaying that is the highest bar that is not broken in five days
we can give a negative value ti either of the formulas since they are boolean formulas we can plot them together in the chart and when both conditions are true it will so in the histogram as 100 and -100 so then you know that both conditions are meet otherwise it will be only 100 or -100 as a songle bar in the histogram
what you think
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
OK, so you plot the following.
MAXH5 <= H5 AND H5 > H6
And you plot the following.
SinceTrue(MAXH5 <= H5 AND H5 > H6, 4) = -1
You still miss the 5/22/17 swing high because while it returns true for the first formula, it returns false for the second.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |