Offset Value from Bartype() Search?

Hi,
I am looking at an alternate way to identify Swing highs and Swing lows (pivot points), using the Bartype() function.
Using the Bartype() function it may be possible to count the Offset from the most recent bar. I.e. if there are a series of Higher bars it could find the point where the Swing up started by identifying the last prior Down bar (or Outside bar). If it was possible to use that Offset value as a variable then it may be possible to start another back search looking for a Swing high by finding the next Up bar back, and so on. The include diagram may help explain.
All this would require the ability to create variables for the Offset amounts and then use them in the Bartype() search function.

Is this possible?

Cheers, Lester

Hi Lester.

I think what you are looking for can be done with the Gann Swing Overlay (uses higher and lower bars). You can have a ShowBar show you when the Swing Start changes value. Note: can’t use swing end as that is adjusted for every bar that is higher or lower/ The swing start only changes when a new swing is created).

You can also use the Pivot function. It’s not looking at BarType but It gets you the same result.

Hope that helps

Mathew

Hi Mathew,
Thank you for your reply. I am trying to think of different approach to the question I posed under the earlier post title of “Dow Swing”. I have copied and pasted the original question under this post.
The Gann Swing Overlay (GSO) is great for Gann Swings, however it cannot be used to make a Dow Swing because of the way it considers an Outside bar in the middle of a swing. Dow swing requires it to ignore the Outside bar unless it forms either the start or end of the swing.
The only control in the current GSO is to set it to immediately consider the Outside bar or wait until the next bar to form.
I believe the Pivot Function needs to be given a set percentage to decide on swing turns, rather than counting the secession of up or down bars. So, there may be occasions that miss a true Dow Swing.
Thankfully the problem has mostly been solved by Charles (Chip) on page 2 of my prior post “Dow Swing”. I was just trying a different path, plus looking at the possibility of scripting by using the “Offset” function to set up precise relations to different parts of the formula.
Regards, Lester
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
I am looking for a script for Dow Swing. Dow Swing is a technique taught by Dale Gillham of Wealth Within.
It is similar to Gann Swing. However in a Gann Swing; outside bars are always considered. In Dow Swing they are treated as part of the trend unless they happen to form the peak or trough?
The GANNSWING() function always includes consideration of Outside bars, even if it is not listed in the parenthesis. There is no DOWSWING function!

Hi Lester,

With the Pivot function, that is based on bar counts (there are no percentage calculations involved). Other than that, I’m not sure that there is much more available in scripting.

All the best

Mathew

Hi Mathew,

Thank you for your help. I shall investigate Pivots further.

Regards, Lester