Average of Swings Using Shifting of Arrays 5/23/08

16:47 SimonB: Hi Howard, wanted to know if I can plot a channel based on a few highs and lows, to have more of a smooth wave, for example if I take only lets say last 3 cycle highs, on any time frame, and 3 lows

16:48 Ensign Howard: so you want to average last 3 swing highs for a composite High and average last 3 swing lows for a composite Low

16:48 SimonB: yes

16:49 Ensign Howard: 1 moment, will show solution

17:03 Ensign Howard: the two channel lines are plotted on the chart

17:04 Ensign Howard: now lets discuss the DYO design

17:10 Ensign Howard: this DYO will do it for you as shown on the chart

17:11 Ensign Howard: I will discuss briefly the concept

17:11 Ensign Howard: will use the Pesavento Patterns tool to find the swing highs and lows as shown on the chart image -06

17:15 Ensign Howard: Line A will be a flag that is true a few bars after a turn when a new trend starts... this means prior swing point is locked in.

17:15 Ensign Howard: Line Dwill be true if this new trend is a rising trend, and if so, Line C will be True and we can now average the prior swing lows.

17:17 Ensign Howard: Now if we are at the event to average the prior lows, we do Line E, which is the clever part, to shift GV 210, 211,212, and 213 rightward one position, so 213 gets 212, 212 gets 211, 211 gets 210, and 210 just got the swing price.

17:18 Ensign Howard: Line J will plot the average of 211, 212, and 213, which are 3 swing low prices.

17:18 SimonB: that is clever

17:18 Ensign Howard: Line F tests if trend was falling, and if so and at a new trend event, we will want to average 3 swing highs and for that Line H will shift the 210 price leftward instead of rightward.

17:19 Ensign Howard: so 207 will get 208, 208 gets 209, 209 gets 210 and Line I will then average these 3 swing high prices in 207, 208, and 209

17:20 Ensign Howard: so the clever part was 1) knowing when to update the prices to average by the Line Trend Change event

17:20 Ensign Howard: 2) shift rightward to remember swing lows

17:20 Ensign Howard: 3) shift leftward to remember swing highs

17:20 Ensign Howard: 4) average 3 highs and plot

17:21 Ensign Howard: 5) average 3 lows and plot

17:21 SimonB: and all that took you 10 min, wow

17:21 Ensign Howard: and we got it all done in 1 DYO using 11 lines of coding

17:21 SimonB: thank you very much

17:23 Ensign Howard: and if you examine where it stair steps, you will see it happens where a few bars are in place after a swing, and thus the prior swing is now locked in and can be used in a new average

17:24 SimonB: I see

17:24 Ensign Howard: Do you like what you see... is this what you hoped to have?

17:25 SimonB: Calculations for sure, the only thing I saw before that was different, is that it looked like a envelope channel, more like a wave, but this will work. I saw it applied to longer term charts, like weekly cycles

17:26 Ensign Howard: The implementation is time frame independent.... will work on any chart, and you can adjust sensitivity in the Pesavento Patterns tool to have more or fewer swings.

17:27 SimonB: I will play with it, thanks again, bye

17:28 Ensign Howard: Welcome

Last updated 05/25/2008