RicardoSantos

[RS]Fractal Pattern Recognition V0

EXPERIMENTAL: reads the rates for the last top/bottom in a zigzag fractal series, outputs XAB, XAD, ABC , and BCD rates, im interested in earing what your opinion is as im a total noob in harmonics :p.

use with Fractals V5 for visual confirmation ;).
즐겨찾기 스크립트에서 빼기 즐겨찾기 스크립트에 넣기
study(title="[RS]Fractal Pattern Recognition V0", overlay=false)
//  ||---   Fractal Recognition:
filterBW = input(true, title="filter Bill Williams Fractals:")
filterFractals = input(false, title="Filter fractals using extreme method:")
length = input(24, title="Extreme Window:")

regulartopfractal = high[4] < high[3] and high[3] < high[2] and high[2] > high[1] and high[1] > high[0]
regularbotfractal = low[4] > low[3] and low[3] > low[2] and low[2] < low[1] and low[1] < low[0]

billwtopfractal = filterBW ? false : (high[4] < high[2] and high[3] < high[2] and high[2] > high[1] and high[2] > high[0] ? true : false)
billwbotfractal = filterBW ? false : (low[4] > low[2] and low[3] > low[2] and low[2] < low[1] and low[2] < low[0] ? true : false)

ftop = filterBW ? regulartopfractal : regulartopfractal or billwtopfractal
fbot = filterBW ? regularbotfractal : regularbotfractal or billwbotfractal

topf = ftop ? high[2] >= highest(high, length) ? true : false : false
botf = fbot ? low[2] <= lowest(low, length) ? true : false : false

filteredtopf = filterFractals ? topf : ftop
filteredbotf = filterFractals ? botf : fbot
//  ||------------------------------------------------------------------------------------------------------

//plotshape(filteredtopf, style=shape.triangledown, location=location.abovebar, color=red, text="•", offset=-2)
//plotshape(filteredbotf, style=shape.triangleup, location=location.belowbar, color=lime, text="•", offset=-2)
//  ||---   V1 : Added Swing High/Low Option
//ShowSwingsHL = input(true)
//highswings = filteredtopf == false ? na : valuewhen(filteredtopf == true, high[2], 2) < valuewhen(filteredtopf == true, high[2], 1) and valuewhen(filteredtopf == true, high[2], 1) > valuewhen(filteredtopf == true, high[2], 0)
//lowswings = filteredbotf == false ? na : valuewhen(filteredbotf == true, low[2], 2) > valuewhen(filteredbotf == true, low[2], 1) and valuewhen(filteredbotf == true, low[2], 1) < valuewhen(filteredbotf == true, low[2], 0)
//---------------------------------------------------------------------------------------------------------
//  ||---   Offset calculation:
//  ||--- unable to use, plots cant use series for offset value...
//hsoffset = n-valuewhen(ftop == true, n[2], 1)
//lsoffset = n-valuewhen(fbot == true, n[2], 1)
//---------------------------------------------------------------------------------------------------------
//plotshape(ShowSwingsHL ? highswings : na, style=shape.triangledown, location=location.abovebar, color=maroon, text="H", offset=-2)
//plotshape(ShowSwingsHL ? lowswings : na, style=shape.triangleup, location=location.belowbar, color=green, text="L", offset=-2)
//  ||---   V2 : Plot Lines based on the fractals.
//showchannel = input(true)
//plot(showchannel ? (filteredtopf ? high[2] : na) : na, color=black, offset=-2)
//plot(showchannel ? (filteredbotf ? low[2] : na) : na, color=black, offset=-2)
//---------------------------------------------------------------------------------------------------------
//  ||---   HLswings channel: unable to offset values
//plot(showchannel ? (highswings ? high[2] : na) : na, color=black, offset=-2)
//plot(showchannel ? (lowswings ? low[2] : na) : na, color=black, offset=-2)
//----------------------------------------------------------------------------------------------------------
//  ||---   ZigZag:
//showZigZag = input(true)


istop = filteredtopf ? true : false
isbot = filteredbotf ? true : false
topcount = barssince(istop)
botcount = barssince(isbot)

zigzag = (
        istop and topcount[1] > botcount[1] ? high[2] :
        isbot and topcount[1] < botcount[1] ? low[2] :
        na )
//zigzag = not showZigZag ? na : ( filteredtopf == true ? high[2] : filteredbotf == true ? low[2] : na )
//plot(zigzag, color=black, offset=-2)

//  ||---   Pattern Recognition:


//istop() => zigzag == filteredtopf
//isbot() => zigzag == filteredbotf

x = valuewhen(zigzag, zigzag, 4) 
a = valuewhen(zigzag, zigzag, 3) 
b = valuewhen(zigzag, zigzag, 2) 
c = valuewhen(zigzag, zigzag, 1) 
d = valuewhen(zigzag, zigzag, 0)

xab = (abs(b-a)/abs(x-a))
xad = (abs(a-d)/abs(x-a))
abc = (abs(b-c)/abs(a-b))
bcd = (abs(c-d)/abs(b-c))

plot(xab, color=xab != xab[1] ? na : gray, offset=-2)
plot(xad, color=xad != xad[1] ? na : black, offset=-2)
plot(abc, color=abc != abc[1] ? na : teal, offset=-2)
plot(bcd, color=bcd != bcd[1] ? na : olive, offset=-2)

plotshape(xab != xab[1] ? xab : na, text="XAB", color=gray, location=location.absolute, offset=-2)
plotshape(xad != xad[1] ? xad : na, text="XAD", color=black, location=location.absolute, offset=-2)
plotshape(abc != abc[1] ? abc : na, text="ABC", color=teal, location=location.absolute, offset=-2)
plotshape(bcd != bcd[1] ? bcd : na, text="BCD", color=olive, location=location.absolute, offset=-2)

//bgcolor(xd <= 0.8 and xd >= 0.6 ? black : na, transp=25)
//plot(topcounter, color=green, offset=-2)
//plot(botcounter, color=red, offset=-2)
is this code valid for MT4 ? if not , for which trading station is valid ?
응답
What kind of Harmonics you are trying to convey here (Gartley, Bat, Cypher, Crab? )
응답
this only reads the rates between swings in the zigzag (pattern independent).
+1 응답
it gives the % rates for the last tops/bottoms in a fractal zigzag () for xabcd format interpretation, granted its a bit blunt visually. its mainly a case study slash method for further interpretation of patterns
응답
Bastioun RicardoSantos
Thank you for your answer. I am sorry but I am not an english spoken person so I hardly understand what you just said
응답
I would love to tell you if it works well but could you please explain in details how it works ?
+1 응답
홈으로 스탁 스크리너 포렉스 스크리너 크립토 스크리너 이코노믹 캘린더 사용안내 차트 특징 프라이싱 하우스룰(내부규정) 모더레이터 웹사이트 & 브로커 솔루션 위젯 차팅 솔루션 라이트웨이트 차팅 라이브러리 헬프 센터 프렌드 리퍼하기 기능 개발/개선 요청 블로그 & 뉴스 잦은물음 위키 트위터
프로화일 프로화일설정 계정 및 빌링 프렌드 리퍼하기 나의 서포트 티켓 헬프 센터 공개아이디어 팔로어 팔로잉 비밀메시지 채팅 로그아웃