The reverse Donchian indicator is a modified version of the classic Donchian channel, in which the values are reversed: higher high and lower low, with higher low and lower high. And calculated upon the occurrence of conditions interdependent on these values, which further strengthen the validity of trend following signals. You enter long and exit short when the current low is greater than the maximum value and you enter short and exit long when the current high is less than the minimum value. There is only one period parameter to adapt based on the trader’s different needs such as: size of the trend to intercept, volatility to filter and chosen timeframe.
Here is the code.
If you have in mind to improve the optimization of period, perhaps by finding solutions to optimize it automatically, or you intend to create an ad hoc strategy, do not hesitate to create a new topic. I will be happy to cowork with you.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
period=10 if (low)>(maximum) then maximum=low minimum=lowest[period](high) endif if (high)<(minimum) then maximum=highest[period](low) minimum=(high) endif media=(maximum+minimum)/2 return (maximum) as "maximum", (minimum) as "minimum", media as "media" |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
A question: what are the initial (or default) values of maximum and minimum in the execution of the two conditions of the code PRT?