Fractal charts

KelvinHand

Well-Known Member
#12
Well formula by empotch was close..but waiting for Seniors like Kelvinhand or Johnny to provide any more close formula.

Thanx you
What so great about kelvinhand?
Johnny & MasterMind007 is superior then him.

Empotch is already very good in ZigZag, Trendline ..etc. Fractal is nut to him.

You want fractal afl, easily found in:
http://www.wisestocktrader.com/indicators/775-awesome-oscillator-ao OR http://www.amibroker.com/library/detail.php?id=1104
http://www.wisestocktrader.com/indicators/456-elliot-wave-fractal

just extract out from there, port over Empotch's afl will do:
Code:
_SECTION_BEGIN("KH-Fractal");

//-- Created by Kelvinhand
Hn1= Ref(H, -1); 
Hn2= Ref(H, -2); 
Hn3= Ref(H, -3); 
Hn4= Ref(H, -4); 

Ln1= Ref(L, -1); 
Ln2= Ref(L, -2); 
Ln3= Ref(L, -3); 
ln4= Ref(L, -4); 

PH = Hn2 >= Hn1 AND Hn2 >= Hn3 AND Hn2>H AND Hn2>Hn4 /*AND Ln2>Ln3 AND Ln2> Ln1 */AND Hn2>Ln2;
PL = Ln2 <= Ln1 AND Ln2 <= Ln3 AND Ln2<L AND Ln2<Ln4 /*AND Hn2<Hn3 AND Hn2<Hn1 */AND Hn2>Ln2;

 
PH=Ref(PH,2);
PL=Ref(PL,2); 

PH[BarCount-1]= Null;
PL[BarCount-1]= Null;

PH[BarCount-2]= Null;
PL[BarCount-2]= Null;



PlotShapes( shapeSmallDownTriangle * PL, colorGreen, 0, L, 10);
PlotShapes(  shapeSmallUpTriangle * PH, colorRed, 0, H, 10);



/*
PHighPrice = ValueWhen( PH, H );
PLowPrice = ValueWhen( PL, L );


Plot(PLowPrice, "Fractal Low", colorGreen, styleDots | styleNoLine);
Plot(PHighPrice, "Fractal High", colorRed, styleDots | styleNoLine);
*/
_SECTION_END();
 
Last edited:

sr114

Well-Known Member
#13
Confusion between 5bar or 6 bar fractal chart or the confusion abut the fractal chart definition. so to clear the confusion lets re visit the definition of "Fractal Charts".

A Trader's Guide To Using Fractals
Many people believe that the markets are random. In fact, one of the most prominent investing books out there is "A Random Walk Down Wall Street" (1973) by Burton G. Malkiel, who argues that throwing darts at a dartboard is likely to yield results similar to those achieved by a fund manager (and Malkiel does have many valid points).

However, many others argue that although prices may appear to be random, they do in fact follow a pattern in the form of trends. One of the most basic ways in which traders can determine such trends is through the use of fractals. Fractals essentially break down larger trends into extremely simple and predictable reversal patterns. This article will explain what fractals are and how you might apply them to your trading to enhance your profits.

What Are Fractals?
When many people think of fractals in the mathematical sense, they think of chaos theory and abstract mathematics. While these concepts do apply to the market (it being a nonlinear, dynamic system), most traders refer to fractals in a more literal sense. That is, as recurring patterns that can predict reversals among larger, more chaotic price movements.

These basic fractals are composed of five or more bars. The rules for identifying fractals are as follows:
A bearish turning point occurs when there is a pattern with the highest high in the middle and two lower highs on each side.
A bullish turning point occurs when there is a pattern with the lowest low in the middle and two higher lows on each side.
The fractals shown in Figure 1 are two examples of perfect patterns. Note that many other less perfect patterns can occur, but the basic pattern should remain intact for the fractal to be valid.

The obvious drawback here is that fractals are lagging indicators - that is, a fractal can't be drawn until we are two days into the reversal. While this may be true, most significant reversals last many more bars, so most of the trend will remain intact (as we will see in the example below).

Applying Fractals to Trading
Like many trading indicators, fractals are best used in conjunction with other indicators or forms of analysis. Perhaps the most common confirmation indicator used with fractals is the "Alligator indicator", a tool that is created by using moving averages that factor in the use of fractal geometry. The standard rule states that all buy rules are only valid if below the "alligator's teeth" (the center average), and all sell rules are only valid if above the alligator's teeth.

As you can see, the primary drawback to this system is the large swings that take place. Notice, for example, that the latest fractal had a drawdown of over 100 pips and still has not hit an exit point. However, there are countless other techniques that can be applied in conjunction with fractals to produce profitable trading systems.

Figure 3 shows a forex trading setup that uses a combination of fractals (multiple time frames), Fibonacci-based moving averages (placed at 89, 144, 233, 377 and their inverses) and a momentum indicator. Let's look at a recent trade setup for the GBP/USD currency pair to see how fractals can help:


Here is a basic rule setup that is used when using a chart with a four-hour time frame:
Initiate a position when the price has hit the farthest Fibonacci band, but only after a daily (D1) fractal takes place.
Exit a position after a daily (D1) fractal reversal takes place.
Notice how the fractals pinpoint meaningful tops and bottoms? This helps to take the guesswork out of deciding at which Fibonacci level to trade - all we have to do is check to see if the daily fractal occurred. We should also note that the trend strength began increasing at the sell fractal, and topped at the buy fractal. Although we lose some pips with the confirmation, it saves us from losing out on mere market noise - 139 pips certainly isn't bad for three days! (For further reading, see Trading Without Noise.)

Things to Consider
Here are a few things to remember when using fractals:
They are lagging indicators. They are best used as confirmation indicators to help confirm that a reversal did take place. Real-time tops and bottoms can be surmised with other techniques.
The longer the time period (i.e. the number of bars required for a fractal), the more reliable the reversal. However, you should also remember that the longer the time period, the lower the number of signals generated.
It is best to plot fractals in multiple time frames and use them in conjunction with one another. For example, only trade short-term fractals in the direction of the long-term ones. Along these same lines, long-term fractals are more reliable than short-term fractals.
Always use fractals in conjunction with other indicators or systems. They work best as decision support tools, not as indicators on their own.
Conclusion
As you can see, fractals can be extremely powerful tools when used in conjunction with other indicators and techniques, especially when used to confirm reversals. The most common usage is with the "Alligator indicator"; however, there are other uses too, as we've seen here. Overall, fractals make excellent decision support tools for any trading method.

by Justin Kuepper
[for the illustration please visit the below link]

http://www.investopedia.com/articles/trading/06/fractals.asp
 
Last edited:

johnnypareek

Well-Known Member
#14
What so great about kelvinhand?
Johnny & MasterMind007 is superior then him.

Empotch is already very good in ZigZag, Trendline ..etc. Fractal is nut to him.

You want fractal afl, easily found in:
http://www.wisestocktrader.com/indicators/775-awesome-oscillator-ao OR http://www.amibroker.com/library/detail.php?id=1104
http://www.wisestocktrader.com/indicators/456-elliot-wave-fractal

just extract out from there, port over Empotch's afl will do:
Code:
_SECTION_BEGIN("KH-Fractal");

//-- Created by Kelvinhand
Hn1= Ref(H, -1); 
Hn2= Ref(H, -2); 
Hn3= Ref(H, -3); 
Hn4= Ref(H, -4); 

Ln1= Ref(L, -1); 
Ln2= Ref(L, -2); 
Ln3= Ref(L, -3); 
ln4= Ref(L, -4); 

PH = Hn2 >= Hn1 AND Hn2 >= Hn3 AND Hn2>H AND Hn2>Hn4 AND Ln2>Ln3 AND Ln2> Ln1 AND Hn2>Ln2;
PL = Ln2 <= Ln1 AND Ln2 <= Ln3 AND Ln2<L AND Ln2<Ln4 AND Hn2<Hn3 AND Hn2<Hn1 AND Hn2>Ln2;

 
PH=Ref(PH,2);
PL=Ref(PL,2); 

PH[BarCount-1]= Null;
PL[BarCount-1]= Null;

PH[BarCount-2]= Null;
PL[BarCount-2]= Null;



PlotShapes( shapeSmallDownTriangle * PL, colorGreen, 0, L, 10);
PlotShapes(  shapeSmallUpTriangle * PH, colorRed, 0, H, 10);



/*
PHighPrice = ValueWhen( PH, H );
PLowPrice = ValueWhen( PL, L );


Plot(PLowPrice, "Fractal Low", colorGreen, styleDots | styleNoLine);
Plot(PHighPrice, "Fractal High", colorRed, styleDots | styleNoLine);
*/
_SECTION_END();


HTML:
What so great about kelvinhand?
Johnny & MasterMind007 is superior then him.
Its not true. You really are. This is your style as all good peoples say like this. I am feeling very proud though. Stuck with something serious so inactive a bit.

johnny
 
#15
What so great about kelvinhand?
Johnny & MasterMind007 is superior then him.

Empotch is already very good in ZigZag, Trendline ..etc. Fractal is nut to him.

You want fractal afl, easily found in:
http://www.wisestocktrader.com/indicators/775-awesome-oscillator-ao OR http://www.amibroker.com/library/detail.php?id=1104
http://www.wisestocktrader.com/indicators/456-elliot-wave-fractal

just extract out from there, port over Empotch's afl will do:
Code:
_SECTION_BEGIN("KH-Fractal");

//-- Created by Kelvinhand
Hn1= Ref(H, -1); 
Hn2= Ref(H, -2); 
Hn3= Ref(H, -3); 
Hn4= Ref(H, -4); 

Ln1= Ref(L, -1); 
Ln2= Ref(L, -2); 
Ln3= Ref(L, -3); 
ln4= Ref(L, -4); 

PH = Hn2 >= Hn1 AND Hn2 >= Hn3 AND Hn2>H AND Hn2>Hn4 /*AND Ln2>Ln3 AND Ln2> Ln1 */AND Hn2>Ln2;
PL = Ln2 <= Ln1 AND Ln2 <= Ln3 AND Ln2<L AND Ln2<Ln4 /*AND Hn2<Hn3 AND Hn2<Hn1 */AND Hn2>Ln2;

 
PH=Ref(PH,2);
PL=Ref(PL,2); 

PH[BarCount-1]= Null;
PL[BarCount-1]= Null;

PH[BarCount-2]= Null;
PL[BarCount-2]= Null;



PlotShapes( shapeSmallDownTriangle * PL, colorGreen, 0, L, 10);
PlotShapes(  shapeSmallUpTriangle * PH, colorRed, 0, H, 10);



/*
PHighPrice = ValueWhen( PH, H );
PLowPrice = ValueWhen( PL, L );


Plot(PLowPrice, "Fractal Low", colorGreen, styleDots | styleNoLine);
Plot(PHighPrice, "Fractal High", colorRed, styleDots | styleNoLine);
*/
_SECTION_END();


Hello Kelvinhand,

Thanx you for all details.
I have compared your Kh-fractal Formula with ED POTTASCH Formula (Posted by Trash on previous page).

Can you please add Up and down arrows to ED POTTASCH AFL rather then DOTS???

Thanx you in advance




Formula below -

// Ed Pottasch

period = Param( "Period", 5, 2, 50, 1 );

// define fractals
HHV_ = HHV( H, period );
LLV_ = LLV( L, period );
PHigh = H > Ref( HHV_, -1 ) AND Ref( HHV_, period ) <= H;
PHighPrice = ValueWhen( PHigh, H );
PLow = L < Ref( LLV_, -1 ) AND Ref( LLV_, period ) >= L;
PLowPrice = ValueWhen( PLow, L );

// chart
GraphXSpace = 5;
SetChartOptions( 0, chartShowDates );

Plot( C, "Price", colorWhite, styleCandle );

PlotShapes( shapeSmallCircle * PLow, colorGreen, 0, L, -10 );
PlotShapes( shapeSmallCircle * PHigh, colorRed, 0, H, 10 );
Plot(PLowPrice, "Fractal Low", colorGreen, styleDots | styleNoLine);
Plot(PHighPrice, "Fractal High", colorRed, styleDots | styleNoLine);


Waiting for reply
 

trash

Well-Known Member
#16
Hello Kelvinhand,

Thanx you for all details.
I have compared your Kh-fractal Formula with ED POTTASCH Formula (Posted by Trash on previous page).

Can you please add Up and down arrows to ED POTTASCH AFL rather then DOTS???

Thanx you in advance




Formula below -

// Ed Pottasch

period = Param( "Period", 5, 2, 50, 1 );

// define fractals
HHV_ = HHV( H, period );
LLV_ = LLV( L, period );
PHigh = H > Ref( HHV_, -1 ) AND Ref( HHV_, period ) <= H;
PHighPrice = ValueWhen( PHigh, H );
PLow = L < Ref( LLV_, -1 ) AND Ref( LLV_, period ) >= L;
PLowPrice = ValueWhen( PLow, L );

// chart
GraphXSpace = 5;
SetChartOptions( 0, chartShowDates );

Plot( C, "Price", colorWhite, styleCandle );

PlotShapes( shapeSmallCircle * PLow, colorGreen, 0, L, -10 );
PlotShapes( shapeSmallCircle * PHigh, colorRed, 0, H, 10 );
Plot(PLowPrice, "Fractal Low", colorGreen, styleDots | styleNoLine);
Plot(PHighPrice, "Fractal High", colorRed, styleDots | styleNoLine);


Waiting for reply
And why can't you just look at the manual yourself looking for PlotShapes function. There you would find the according shapes to choose from https://amibroker.com/guide/afl/afl_view.php?id=206
 
#20
What so great about kelvinhand?
Johnny & MasterMind007 is superior then him.

Empotch is already very good in ZigZag, Trendline ..etc. Fractal is nut to him.

You want fractal afl, easily found in:
http://www.wisestocktrader.com/indicators/775-awesome-oscillator-ao OR http://www.amibroker.com/library/detail.php?id=1104
http://www.wisestocktrader.com/indicators/456-elliot-wave-fractal

just extract out from there, port over Empotch's afl will do:
Code:
_SECTION_BEGIN("KH-Fractal");

//-- Created by Kelvinhand
Hn1= Ref(H, -1); 
Hn2= Ref(H, -2); 
Hn3= Ref(H, -3); 
Hn4= Ref(H, -4); 

Ln1= Ref(L, -1); 
Ln2= Ref(L, -2); 
Ln3= Ref(L, -3); 
ln4= Ref(L, -4); 

PH = Hn2 >= Hn1 AND Hn2 >= Hn3 AND Hn2>H AND Hn2>Hn4 /*AND Ln2>Ln3 AND Ln2> Ln1 */AND Hn2>Ln2;
PL = Ln2 <= Ln1 AND Ln2 <= Ln3 AND Ln2<L AND Ln2<Ln4 /*AND Hn2<Hn3 AND Hn2<Hn1 */AND Hn2>Ln2;

 
PH=Ref(PH,2);
PL=Ref(PL,2); 

PH[BarCount-1]= Null;
PL[BarCount-1]= Null;

PH[BarCount-2]= Null;
PL[BarCount-2]= Null;



PlotShapes( shapeSmallDownTriangle * PL, colorGreen, 0, L, 10);
PlotShapes(  shapeSmallUpTriangle * PH, colorRed, 0, H, 10);



/*
PHighPrice = ValueWhen( PH, H );
PLowPrice = ValueWhen( PL, L );


Plot(PLowPrice, "Fractal Low", colorGreen, styleDots | styleNoLine);
Plot(PHighPrice, "Fractal High", colorRed, styleDots | styleNoLine);
*/
_SECTION_END();
Hello Kelvinhand. Does this formula look into the future when backtesting? T
 

Similar threads