RicardoSantos

[RS]PA Zigzag Fibonacci FAN V0

EXPERIMENTAL:
fan projection from zigzag .
즐겨찾기 스크립트에서 빼기 즐겨찾기 스크립트에 넣기
study(title='[RS]PA Zigzag Fibonacci FAN V0', shorttitle='F', overlay=true)
useHA = input(false, title='Use Heikken Ashi Candles')
useAltTF = input(true, title='Use Alt Timeframe')
tf = input('D', title='Alt Timeframe')

zigzag() =>
    _isUp = close >= close[1]
    _isDown = close <= close[1]
    _direction = _isUp[1] and _isDown ? -1 : _isDown[1] and _isUp ? 1 : nz(_direction[1])
    _zigzag = _isUp[1] and _isDown and _direction[1] != -1 ? highest(2) : _isDown[1] and _isUp and _direction[1] != 1 ? lowest(2) : na

_ticker = useHA ? heikenashi(tickerid) : tickerid
sz = useAltTF ? (change(time(tf)) != 0 ? security(_ticker, tf, zigzag()) : na) : zigzag()

plot(sz, title='zigzag', color=black, linewidth=2)

//  ||---   Pattern Recognition:

x = valuewhen(sz, sz, 1) 
z = valuewhen(sz, sz, 0)
n_x = valuewhen(sz, n, 1) 
n_z = valuewhen(sz, n, 0)

price_range = z-x
bar_range = n_z-n_x
step = price_range/bar_range
projection = sz ? na : z + ((n-n_z)*step)
projection_n0236 = sz ? na : z + ((n-n_z)*step)*-0.236
projection_n0382 = sz ? na : z + ((n-n_z)*step)*-0.382
projection_n0500 = sz ? na : z + ((n-n_z)*step)*-0.500
projection_n0618 = sz ? na : z + ((n-n_z)*step)*-0.618
projection_n1000 = sz ? na : z + ((n-n_z)*step)*-1.000
projection_n1618 = sz ? na : z + ((n-n_z)*step)*-1.618
projection_n3141 = sz ? na : z + ((n-n_z)*step)*-3.141
plot(title='0.0', series=projection, style=linebr, color=blue)
plot(title='-0.236', series=projection_n0236, style=linebr, color=gray)
plot(title='-0.382', series=projection_n0382, style=linebr, color=yellow)
plot(title='-0.500', series=projection_n0500, style=linebr, color=orange)
plot(title='-0.618', series=projection_n0618, style=linebr, color=red)
plot(title='-1.000', series=projection_n1000, style=linebr, color=black)
plot(title='-1.618', series=projection_n1618, style=linebr, color=maroon)
plot(title='-3.141', series=projection_n3141, style=linebr, color=aqua)
Is it possible to add an alert for when a new fan starts?
응답
Hi Ricardo:

Where the variable n comes from in: n_z = valuewhen(sz, n, 0) as I dont see it been declared.
Thanks.
+2 응답
@RicardoSantos

Request:

Ability to only show the most recent fan. For example, if I set the time frame of the indicator to 1 hour, it would be great it only the current fan that is currently being drawn is shown. Having the option to choose this in the settings would be really great, if possible, and if you are willing! Thanks.
+2 응답
@stockspy, thats not possible to do, its a restriction on how pinescript works.
응답
stockspy RicardoSantos
@RicardoSantos, oh ok thank. Thanks for letting me know.
응답
stockspy stockspy
@stockspy, I really like the script and enjoy many of your stuff
응답
stockspy RicardoSantos
@RicardoSantos, I really like the script and enjoy many of your stuff
+1 응답
And I am guessing the number of times that it repaints will depend on the market itself, but will be interesting to see how often it really does repaint, or if it can handle fluctuations without repainting immediately.
응답
This is quite amazing. If only wanting to use it as minimally as possible, it appears to be useful in directing you as to which overall direction the market is trending (the fan is fanning upwards in an uptrend, and fanning downwards in a downtrend). I've noticed days where the market could surge upwards during the day, but the overall fan stays pointed downwards, and the market ultimately lowers back down at least a bit from it's intraday high.

Although, I haven't witnessed this yet during live trading, since I just found this great scipt, so looking forward to that!
응답
Hi. RicardoSantos. Does it repaint?

thank you for making this masterpiece :)
응답
홈으로 스탁 스크리너 포렉스 스크리너 크립토 스크리너 이코노믹 캘린더 사용안내 차트 특징 프라이싱 하우스룰(내부규정) 모더레이터 웹사이트 & 브로커 솔루션 위젯 차팅 솔루션 Help Center 기능 개발/개선 요청 블로그 & 뉴스 잦은물음 위키 트위터
프로화일 프로화일설정 계정 및 빌링 트레이딩뷰 코인 나의 서포트 티켓 Help Center 공개아이디어 팔로어 팔로잉 비밀메시지 채팅 로그아웃