frankie.baumann

Fractals average breakout [FB]

My first indicator.
A simple average of last 1 to 10 fractals (top and bottom)
Trade breakouts of top or bottom lines.
Feel free to use and experiment with.
Frank Baumann
Remove from Favorite Scripts Add to Favorite Scripts
//
// @author frankie.baumann
//

study("Fractals average breakout [FB]",shorttitle="FAB",overlay=true)

LookBack = input(5,minval=1,maxval=10)
ShMid = input(true, type=bool, title = "Show Midline?")
ShFL = input(true, type=bool, title = "Show Fractal lines?")

th = high[2]>high[1] and high[2]>high and high[2]>high[3] and high[2]>high[4] ? -1 : 0

bl = low[2]<low[1] and low[2]<low and low[2]<low[3] and low[2]<low[4] ? 1 : 0

tot = th + bl
pl = abs(tot)>=1 ? 1 : 0

// plotarrow(pl==1 ? tot : na,colorup=green,colordown=red,offset=-2,maxheight=10)

lowline = (valuewhen(tot==1, low[2], 0) + (LookBack>1 ? valuewhen(tot==1, low[2], 1) : 0)
    + (LookBack>2 ? valuewhen(tot==1, low[2], 2) : 0) + (LookBack>3 ? valuewhen(tot==1, low[2], 3) : 0)
    + (LookBack>4 ? valuewhen(tot==1, low[2], 4) : 0) + (LookBack>5 ? valuewhen(tot==1, low[2], 5) : 0)
    + (LookBack>6 ? valuewhen(tot==1, low[2], 6) : 0) + (LookBack>7 ? valuewhen(tot==1, low[2], 7) : 0)
    + (LookBack>8 ? valuewhen(tot==1, low[2], 8) : 0) + (LookBack>9 ? valuewhen(tot==1, low[2], 9) : 0)
    )/LookBack
plot(ShFL ? lowline : na, style=line, linewidth=2, color=green) //, offset=-2)

highline = (valuewhen(tot==-1, high[2], 0) + (LookBack>1 ? valuewhen(tot==-1, high[2], 1) : 0)
    + (LookBack>2 ? valuewhen(tot==-1, high[2], 2) : 0) + (LookBack>3 ? valuewhen(tot==-1, high[2], 3) : 0)
    + (LookBack>4 ? valuewhen(tot==-1, high[2], 4) : 0) + (LookBack>5 ? valuewhen(tot==-1, high[2], 5) : 0)
    + (LookBack>6 ? valuewhen(tot==-1, high[2], 6) : 0) + (LookBack>7 ? valuewhen(tot==-1, high[2], 7) : 0)
    + (LookBack>8 ? valuewhen(tot==-1, high[2], 8) : 0) + (LookBack>9 ? valuewhen(tot==-1, high[2], 9) : 0)
    )/LookBack
plot(ShFL ? highline : na, style=line, linewidth=2, color=red)

MidLine = (highline+lowline)/2
plot(ShMid ? MidLine : na, style=line, linewidth=2)
Sinuhet
2 years ago
thx. Just a question: when the buy or sell signals (arrows) get generated in real time? Is it after the close of the candle?
Reply
frankie.baumann Sinuhet
2 years ago
Sorry ... I forgot to click reply ... my answer is below :)
Reply
frankie.baumann
2 years ago
@Sinuhet
Oh no ... the arrows are just my own fractals indicator. There are no buy and sell signals. The indicator here is only the 3 lines Top Bottom and Middle.
The Top line is the average of the last 5 top fractals.
The Bottom line is the average of the last 5 bottom fractals.
The Middle line is just the average of the Top and Bottom lines.
I am looking at trades breaking out over the Top or Bottom lines (To be confirmed by other indicators as well)
I just use the raw fractals to get a better perspective of the breakouts and also look at volatility and any oscillator to help me make a decision.
In other words, I try to look at the big picture before I make any decision :)
Reply
Sinuhet frankie.baumann
2 years ago
nice thank you for reply. I am using TD-Sequential and as by any indicator, I need always to follow higher time frames to avoid trade againts the trade. This breakout stuff is interesting to me - perhaps I can use your technique with +/- volume to to detect Elliott Wave 3. The EW oscillator is simply not very reliable.
Reply
frankie.baumann Sinuhet
2 years ago
Feel free to experiment... :)
I am currently exploring breakouts to trade short term options. And I always look at higher time frames to get an idea of the sustainability of the trend and if the breakout corresponds. I also noticed that you can easily see consolidation in the price when the Top and Bottom lines are close together.
I like fractals because they tend to adapt to the market movement unlike moving averages.
Enjoy!
Reply
Sinuhet frankie.baumann
2 years ago
yes, fractals/cycles do work for some time until not and are changed by another fractal/cycle. Moving averages are for nothing, because they just tracked past price action. But TD sequential is different story. Of course they are some false signals (aka BUY setup, but trend continues lower) but if I could combine it with some breakout/volatility indicator that would be nice. I will experiment with your work. Once again Thank you. Sinuhet
Btw. I find interesting your point regarding distance of both external lines to each other - if they get too close to each other, a major move is ahead. Would be of value to quantitatively describe this distance as an indicator with some absolute value? Just looking on both lines remains very subjective...
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Billing Sign Out