Nicolas

Donchian Channel Activator Factor

Category: Indicators By: Nicolas Created: March 3, 2016, 3:13 PM
March 3, 2016, 3:13 PM
Indicators
3 Comments
Donchian Channel Activator Factor

This indicator is made of the classical Donchian Channel, but the upper and lower are factorized by the Average True Range of recent periods (pd value). The trend revert is “activated” when the close crossed above or below the upper or lower line.

////DONCHIAN CHANNEL ACTIVATOR///
///VARIABLE 
//pd = 5
//ot = 1
//Factor = 1

hi = HIGHEST[pd](high)[ot]
lo = LOWEST[pd](low)[ot]
DUpper=hi+Factor*AverageTrueRange[pd](close)
DLower=lo-Factor*AverageTrueRange[pd](close)


if f=1 then
 if close<lo then
  f=-1
  c=DUpper//hi
 else
  c=DLower//lo
 endif
else
 if close>hi then
  f=1
  c=DLower//lo
 else
  c=DUpper//hi
 endif
endif

return c coloured by f as"donchian activator"

 

Download
Filename: Britains-Activator-Factor.itf
Downloads: 252
Nicolas
Nicolas Legend
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

GraHal
11 years ago
#

Nicolas, thank you for your useful and informative response.

Yes I optimise using ProBacktest.

'Mr Britain' (great name! ha) is / was very kind sharing his past work with us all.

Thank You

Graham 

GraHal
11 years ago
#

Hi Nicolas

I like this and would like to understand it fully so please forgive the (maybe) daft questions! ha

When would the Factor be other than 1? I've tried optimising and it came out best at 0.99 so I've left it at 1. Is it to stop 'looping' ... or am I missing a trick here? No need for in depth (save you time) ... just a few words will probably do for me to get my head around and then I'll think on what you say.

I understand the function of the pd and ot setting ... but what does pd and ot stand for please?

Many Thanks

Graham

PS Why is it called  'britains-*-*' ... I'm a bit weird re needing to know odd things! ha

PPS why is my text coming out double-spaced ... I cant see a format option, but I bet you know why Nicolas?    

Nicolas
11 years ago
#

Hi GraHal, the Factor parameter is only a multiplier of the ATR that is added or subtracted to the main lines (hi or lo). So it could be inferior to 1 of course and superior too indeed. I don't know where do you optimized the value? In a ProBacktest strategy?

"pd" is the lookback period of the indicators (ATR and Highest/Lowest values). The "ot" is the period offset of the Highest/Lowest values lookback.

'britains' is the name of the guy who give me a bunch of indicators and strategies to share with the Prorealtime community. He doesn't trade anymore and he found it would be nice to share with others all of his past work.

ProRealCode ProRealCode
Loading...