DALE- !DONCHIAN PRICE CHANNELS !Coded by Rich Denning 2/13/05 !Donchian Channels were introduced by Richard Donchian, a pioneer in the field of trend following. ! The Donchian Channel is a simple trend following breakout system. The Donchian Channel works ! well in trending markets, but doesn't work well in a sideways channel. The signals derived from the ! Price Channel are based on the following basic rules: ! * When price closes above the Donchian Channel, buy long and cover short positions. ! * When price closes below the Donchian Channel, sell short and liquidate long positions. ! The Donchian Channel indicator is not meant to catch tops or bottoms, only trends. ! Trend traders may want to extend the standard 4 week period to 8 weeks in order to wait ! for significant trend signals, while others may shorten the period to a more sensitive 1 or 2 ! weeks for liquidation purposes. ! Upper Band = Highest high in last n bars ! Lower Band = Lowest low in last n bars ! Middle Band = (Upper Band + Lower Band) / 2 ! This indicator is set to run in daily mode, adjustments may be necessary for other time frames. HH10 is HiVal([high],10,0). !Two week HH20 is HiVal([high],20,0). !Four week - classic setting HH40 is HiVal([high],40,0). !Eight week LL10 is LoVal([low],10,0). !Two week LL20 is LoVal([low],20,0). !Four week - classic setting LL40 is LoVal([low],40,0). !Eight week !WITH ONE DAY OFFSET: HH10x1 is HiVal([high],10,1). !Two week HH20x1 is HiVal([high],20,1). !Four week - classic setting HH40x1 is HiVal([high],40,1). !Eight week LL10x1 is LoVal([low],10,1). !Two week LL20x1 is LoVal([low],20,1). !Four week - classic setting LL40x1 is LoVal([low],40,1). !Eight week UpDon is HH20. !Change the HHxx function to change the time frame. LwDon is LL20. !Change the LLxx function to change the time frame. MdDon is (UpDon + LwDon) / 2. ! Plot the above three UDF as custom indicators single line indicators on the upper chart panel. ! Each one must be added as a separate indicator. ! Note: the upper channel could use a different time frame than the lower channel. ! By adding an offset of a day the prior day's value could be used as a stop Rule Library˙˙ CCodeViewš˙˙˙˙00:00