This ‘Donchian bias determinator’ indicator can be used to detect an open or close outside the Donchian channel. After a close on the upper side, the candle colors Blue and after a close below the lower side, the candle colors Red. It is a simplified way to play the Donchian 4 weeks rule (Not yet automated). You can tweak this indicator to your own needs, for example, I left away the Donchian channel to get a plain vanilla chart. (attached images).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
//Donchian bias determinator indicator //05-11-2017 //Marcel van Vliet // mmTYPE=1 (mm type) Upper = HIGHEST[20](HIGH[1]) Lower = LOWEST[20](LOW[1]) Middle = (Upper + Lower) / 2 bodyhigh = max(open,close) bodylow = min(open,close) if(open<=close and close > Upper) then LongWickUp = high LongCandleUp = bodyHigh LongWickDown = low LongCandleDown = bodyLow elsif(open>=close and close > Upper) then LongWickUp = low LongCandleUp = bodyLow LongWickDown = high LongCandleDown = bodyHigh elsif(open<=close and close < Lower) then ShortWickUp = high ShortCandleUp = bodyHigh ShortWickDown = low ShortCandleDown = bodyLow elsif(open>=close and close < Lower) then ShortWickUp = low ShortCandleUp = bodyLow ShortWickDown = high ShortCandleDown = bodyHigh elsif(open<=close and close < Upper and close > Lower) then RangeWickUp = high RangeCandleUp = bodyHigh RangeWickDown = low RangeCandleDown = bodyLow elsif(open>=close and close < Upper and close > Lower) then RangeWickUp = low RangeCandleUp = bodyLow RangeWickDown = high RangeCandleDown = bodyHigh endif //bullish candlesticks if close>Upper then DRAWCANDLE(LongCandleDown,LongWickUp,LongWickDown,LongCandleUp) coloured(0,0,102) endif //bearish candlesticks if close<Lower then DRAWCANDLE(ShortCandleDown,ShortWickUp,ShortWickDown,ShortCandleUp) coloured(200,0,0) endif //neutral candlesticks (Donchian channel) if close<Upper and close>Lower then DRAWCANDLE(RangeCandleDown,RangeWickUp,RangeWickDown,RangeCandleUp) coloured(150,150,150) endif RETURN upper AS "upper", lower AS "lower", middle AS "middle" |
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
If you are interested in my way of trading, please follow me on Twitter @MvvTrading
Excellent, merci !
Excelente indicador, felicitaciones, muy bueno