# Donchian Fibo Channels

526 4
1. Set PRZ level for watching
2. Set period as swing time X 2 (or more)
3. Wait rebound from PRZ or PRZ break (use next if break)
```// Created by PolarSolar 09 May 2016
// Updated: none

study(title="Donchian Fibo Channels", shorttitle="DFC", overlay=true)
length = input(20, minval=1)
lo = lowest(length)
hi = highest(length)
range = abs(hi-lo)
prz = input(0.618, title="PRZ level",minval=0.236, maxval=0.886, step=0.001)
d = close[1]>hi-(range*prz)?1:-1
r236 = d>0?hi-(range*0.236):lo+(range*0.236)
r382 = d>0?hi-(range*0.707):lo+(range*0.382)
r500 = avg(hi,lo)// basis
r618 = d>0?hi-(range*0.618):lo+(range*0.618)
r707 = d>0?hi-(range*0.707):lo+(range*0.707)
r786 = d>0?hi-(range*0.786):lo+(range*0.786)
r886 = d>0?hi-(range*0.886):lo+(range*0.886)

plot(lo, color=gray, linewidth=2, title="HIGH")
plot(hi, color=gray, linewidth=2, title="LOW")
plot(r236, color=#BA55D3, title=".236") // violet
plot(r382, color=#4169E1, title=".382") // blue
plot(r500, color=#00BFFF, linewidth=2, title=".500") // light blue
plot(r618, color=#32CD32, title=".618") // green
plot(r707, color=#FFD700, title=".707") // yellow
plot(r786, color=#FF8C00, title=".786") // orange
plot(r886, color=red, title=".886") // red```
new version published
Ответить
Great idea, waiting for final version)
Ответить
Replace str 12
r382 = d>0?hi-(range*0.707):lo+(range*0.382)
to
r382 = d>0?hi-(range*0.382):lo+(range*0.382)

Ответить
Replace code from str #8

range = abs(hi-lo)
dir = input(true, title="Uptrend?", type=bool)
prz = input(0.618, title="PRZ level",minval=0.236, maxval=0.886, step=0.001)
przd = dir?prz:1-prz
d = close>hi-(range*przd)?1:-1

Because on downtrend channel reversal on incorrect value (prz-1) example: .382 instead .618.
Ответить
RU Русский
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
SV Svenska
TR Türkçe
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
AR العربية