BullCharts Forum Homepage
Forum Home Forum Home > BullCharts > BullScript
  New Posts New Posts RSS Feed: Adding Fractals to BullCharts
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Adding Fractals to BullCharts

 Post Reply Post Reply Page  12>
Author
Message / View First Unread Post
Tanaka View Drop Down
Newbie
Newbie


Joined: 08 Jul 2010
Posts: 18
Post Options Post Options   Quote Tanaka Quote  Post ReplyReply Direct Link To This Post Topic: Adding Fractals to BullCharts
    Posted: 07 Oct 2010 at 3:51pm
Hi guys,

I have no programming knowledge other than cutting and pasting into the indicator builder. I have been using Bill William’s Profitunity System with my forex brokers platform and would like to add it to my BullChart. I need to add Fractals to my screen.

Fractals - 5 bars sequence where middle one has highest High / lowest Low and its preceded and followed two bars have lower highs / higher lows preceded by two lower highs and is followed by two lower highs:

{ Defining up fractal ) =

High1 := Ref(HIGH,-2);

High2 := Ref(HIGH,-1);

High3 := Ref(HIGH,0);

High4 := Ref(HIGH,1);

High5 := Ref(HIGH,2);

If((High3 > High1) AND (High3 > High2) AND (High3 > High4) AND (High3 >

High5), High3,0);

 

{Defining Low Fractal } =

Low1 := Ref(LOW,-2);

Low2 := Ref(LOW,-1);

Low3 := Ref(LOW,0);

Low4 := Ref(LOW,1);

Low5 := Ref(LOW,2);

(If((Low3 low5), Low3,0))


Anyone know how to do this? Help would be much appreciated!


Back to Top
maximo View Drop Down
BullCharts Guru
BullCharts Guru
Avatar

Joined: 02 Sep 2006
Location: Australia
Posts: 232
Post Options Post Options   Quote maximo Quote  Post ReplyReply Direct Link To This Post Posted: 08 Oct 2010 at 6:02am

Heya Tenaka,

I have seen them on MetaTrader, but not on Bullcharts so here goes nothin lol.
If you can paste a link to the Bill williams method of how it works then that would
allow others to see the use of this thing :)
 
 
 

[Description="Fractal of 5 bars, Max"]

[target=price]

{ Fractal Highs }

[linestyle=points; color=blue; width=5]

If(H>ref(H,1) and H>ref(H,-1) and ref(H,-1)>ref(H,-2) and ref(H,1)>ref(H,2), H*1.008,undefined);

{ Fractal Lows }

[color=indian red]

If(L<ref(L,1) and L<ref(L,-1) and ref(L,-1)<ref(L,-2) and ref(L,1)<ref(L,2), L*0.992,undefined);

Back to Top
Tanaka View Drop Down
Newbie
Newbie


Joined: 08 Jul 2010
Posts: 18
Post Options Post Options   Quote Tanaka Quote  Post ReplyReply Direct Link To This Post Posted: 08 Oct 2010 at 11:19am
Thanks Maximo!
 
That formula works well. Only problem is that I don't know how to have them connected to the candle sticks, it would be very convenient to have the up fractals sit just above the candles and the down fractal sit just below.
 
Once again thank you!
 
Tanaka
Back to Top
maximo View Drop Down
BullCharts Guru
BullCharts Guru
Avatar

Joined: 02 Sep 2006
Location: Australia
Posts: 232
Post Options Post Options   Quote maximo Quote  Post ReplyReply Direct Link To This Post Posted: 08 Oct 2010 at 8:16pm
You can move the location of the indicator dot by adjusting those numbers that multiply the H*1.008 (High) and the L*0.992 (Low).   If that's what you mean?
  Currently thats just a fraction under 1% above and below the candles/bars.
3 bar fractals are often used as well.  I'll paste that when time permits.
 
Max  


Edited by maximo - 09 Oct 2010 at 8:43am
Back to Top
maximo View Drop Down
BullCharts Guru
BullCharts Guru
Avatar

Joined: 02 Sep 2006
Location: Australia
Posts: 232
Post Options Post Options   Quote maximo Quote  Post ReplyReply Direct Link To This Post Posted: 09 Oct 2010 at 9:39am
Also a good visual aid for determining trend direction. ie.
Higher Higher, Higher Low, Lower Low, Lower High. 
 
 
 
[Description="Fractal of 3 bars, Max"]

[target=price]

{ Fractal High }

[linestyle=points; color=blue; width=5]

If(H>ref(H,1) and H>ref(H,-1), H*1.005,undefined);

{ Fractal Low }

[color=indian red]

If(L<ref(L,1) and L<ref(L,-1), L*0.995,undefined);



Edited by maximo - 12 Oct 2010 at 8:25am
Back to Top
Tanaka View Drop Down
Newbie
Newbie


Joined: 08 Jul 2010
Posts: 18
Post Options Post Options   Quote Tanaka Quote  Post ReplyReply Direct Link To This Post Posted: 28 Feb 2011 at 4:47pm
Hi guys,

First of all thanks again for the help maximo.

I am wanting to test fractals in tradesim, so I need the above formular to remember the most recent UP fractal high and the most recent DOWN fractal low and draw it on the chart similar to the support/resistance indicator draws a line. This way I could set a buy signal for when the price breaks above the previous up fractal's high. Can this be done?


Edited by Tanaka - 28 Feb 2011 at 5:13pm
Back to Top
Tanaka View Drop Down
Newbie
Newbie


Joined: 08 Jul 2010
Posts: 18
Post Options Post Options   Quote Tanaka Quote  Post ReplyReply Direct Link To This Post Posted: 03 Mar 2011 at 5:24pm
For those who aren't sure how to use fractals I have a link to Bill William's use of fractals. They can be used on shares eventhough the link is from a forex broker.

http://www.alpari.co.uk/en/market-analysis-guide/chaos-theory/index.html

I use them with the Awesome Oscillator (AO):

ma(ma(MP(),5,S) - ma(MP(),34,S),5,S)

you will need to adjust the plot to the up and down wave style thingy.

I have had good success with the method, and am sure it can be better tuned by backtesting different posistion sizing, risk/reward, stops etc...

I'd be very appreciative if my above post could be turned into a formula.

Cheers,

Tanaka Smile


Back to Top
maximo View Drop Down
BullCharts Guru
BullCharts Guru
Avatar

Joined: 02 Sep 2006
Location: Australia
Posts: 232
Post Options Post Options   Quote maximo Quote  Post ReplyReply Direct Link To This Post Posted: 04 Mar 2011 at 8:11pm
Hi Tanaka,
 
They are very good for showing support and resistance.
 
Here is the complete indicator and signal for testing :)
 
 
Note: HoldLevelPeriod can be set to 1 to just show the fractal bars.
  I have also added a close price option which, shows a difference in the
 levels found and provides another testing option.
 
 
 

[Description="Fractal of 5 bars indicator and signal, Max"]

[target=price]

HoldLevelPeriod := Input("Hold Level Period",15,1);

UseHigh:= Input("Use High: 1=True, 0=Close",1,0);

{ Fractal Highs }

[linestyle=points; color=blue; width=5]

UpFractal:=If(UseHigh and H>ref(H,1) and H>ref(H,-1) and ref(H,-1)>ref(H,-2) and ref(H,1)>ref(H,2), H*1.005,If(UseHigh = 0 and H>ref(C,1) and H>ref(C,-1) and ref(C,-1)>ref(C,-2) and ref(C,1)>ref(C,2), H*1.005,undefined));

FrU:=ValueWhen(1,UpFractal,UpFractal);

FrUb:=If(H < FrU and barssince(UpFractal)<HoldLevelPeriod,FrU,undefined);

FrUb;

{ Fractal Lows }

[color=indian red]

DownFractal:=If(UseHigh and L<ref(L,1) and L<ref(L,-1) and ref(L,-1)<ref(L,-2) and ref(L,1)<ref(L,2), L*0.995,If(UseHigh = 0 and L<ref(C,1) and L<ref(C,-1) and ref(C,-1)<ref(L,-2) and ref(C,1)<ref(C,2), L*0.995,undefined));

FrD:=ValueWhen(1,DownFractal,DownFractal);

FrDb:=If(L > FrD and barssince(DownFractal)<HoldLevelPeriod,FrD,undefined);

FrDb;

{ Markers }

[name=Above; linestyle=marker; marker=type2]

SignalUp:=If(Hist(FrUb,1) and H > FrU,FrU,undefined);

SignalUp;

[name=Below; linestyle=marker; marker=type1]

SignalDown:=If(Hist(FrDb,1) and L < FrD,FrD,undefined);

SignalDown;



Edited by maximo - 06 Mar 2011 at 3:37pm
Back to Top
Tanaka View Drop Down
Newbie
Newbie


Joined: 08 Jul 2010
Posts: 18
Post Options Post Options   Quote Tanaka Quote  Post ReplyReply Direct Link To This Post Posted: 08 Mar 2011 at 12:03am
Thank you so much Maximo,

I have just loaded the formula and it looks fantastic! I'm going to have a play around with it tomorrow, and I will let everyone know how it goes.

The look back feature should be very handy while back testing.

You are correct, they are good at showing support and resistance.

Tanaka Smile

p.s I'd be very interested to know if others on this forum are using fractals




Back to Top
maximo View Drop Down
BullCharts Guru
BullCharts Guru
Avatar

Joined: 02 Sep 2006
Location: Australia
Posts: 232
Post Options Post Options   Quote maximo Quote  Post ReplyReply Direct Link To This Post Posted: 11 Mar 2011 at 10:59pm
Nice to hear Tanaka,
 
This should be good to use with a longer term average and volume period.
 
Similar to 10-30 day breakout and Darvas breaks of resistance too.
 
Max
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.69
Copyright ©2001-2010 Web Wiz