Print Page | Close Window

Dynamic Support & Resistance

Printed From: BullCharts Forum
Category: BullCharts
Forum Name: BullScript
Forum Discription: Technical discussion related specifically to the BullScript programming language.
URL: http://www.bullcharts.com.au/forum/forum_posts.asp?TID=678
Printed Date: 13 Apr 2025 at 7:38am
Software Version: Web Wiz Forums 9.69 - http://www.webwizforums.com


Topic: Dynamic Support & Resistance
Posted By: maximo
Subject: Dynamic Support & Resistance
Date Posted: 28 Oct 2010 at 12:37pm
Here's an indicator which locks to previous support and resistance area's
for determination of just that or breakouts.
 
Have fun!
 

[Description="Support & Resistance, Max"]

[Target=price]

LookBack := Input("Look Back Periods",30,1);

F:=input("Labels (1=On, 0=Off)",1,0,1);

A:=input("Average (1=On, 0=Off)",0,0,1);

B5:=(HHV(H,5) + LLV(L,5) + Close)/3.0;

B6:= ma(B5,LookBack-5,S);

Resistance := ValueWhen(1, REF(B5,-1) >= REF(B6,-1) AND B5 <= B6,HHV(H,LookBack));

Support := ValueWhen(1, REF(B5,-1) <= REF(B6,-1) AND B5 >= B6,LLV(L,LookBack));

[color=blue]

Resistance;

[color=red]

Support;

[color=rgb(255,204,0)] {Gold}

if(A,B6,undefined);

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

BO:=if(F AND C>Resistance AND hist(Close,1)<=Resistance,1,0);

if(BO and hist(barssince(BO),1)>8,1,0);

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

BD:=if(F AND C<Support AND hist(Close,1)>=Support,1,0);

if(BD and hist(barssince(BD),1)>8,1,0);




Replies:
Posted By: cudderbean
Date Posted: 08 Nov 2010 at 1:05pm
Thanks, Maximo, for yet another generous contribution.Thumbs%20Up

-------------


Posted By: maximo
Date Posted: 08 Nov 2010 at 10:50pm
Hi cudderbean, thanks for stopping by the forum.   It would be nice if we had more people contributing and discussing some ideas.
 
Here's another support and resistance indicator.  It's similar to darvas boxes, which may account for something.  It clearly defines Uptrend, Consolidation, Downtrend areas.
I like how it indicates when to buy back into a market after a crisis of some kind.
 
It changes the bar colours, so if you want them to return to normal or another colour,
just click on one of the templates on the lower right part of Bullcharts.
 

[Description="Magic Box"]

Periods:=input("periods", 100,1);

Topbox:=If(Ref(H,-3)>=Ref(HHV(H,Periods),-4) AND Ref(H,-2)<Ref(H,-3) AND Ref(H,-1)<Ref(H,-3) AND H< Ref(H,-3),Ref(H,-3),PREVIOUS);

Botbox:=If(Ref(H,-3)>=Ref(HHV(H,Periods),-4) AND Ref(H,-2)<Ref(H,-3) AND Ref(H,-1)<Ref(H,-3) AND H< Ref(H,-3),LLV(L,4),PREVIOUS);

[target=price]

Botbox;

Topbox;

Flag:=input("PaintBars On=1, Off=0",1,0);

[linestyle=pricecolor]

[color=rgb(98,217,98)] Flag=1 and Close>Topbox;

[color=rgb(226,118,118)] Flag=1 and Close<Botbox;

[color=gold] Flag=1 and Close<=Topbox and Close>=Botbox;

 
 


Posted By: cudderbean
Date Posted: 21 Mar 2011 at 3:59pm

Apologies for long gap in response. I have been travelling in exotic places... there's more to life than TA.. well, not much...! hehe

Your Magic Box is very useful combined with other indicators such as vol increase on breakouts, and its very nice to be able to play with the parameters for shorter term look back periods.

The Open and Close price of the day are significant moments also. Would it be possible to change the HHV and LLV to Highest (Close and/or Open) and Lowest (Close and/or Open) or better still.. leave that bracketed parameter as an input as Close and/or Open, High, Low, Typical Price or whatever for backtesting.

Thanks again, Maximo. I have several of your custom indicators in my indicator folder. Its always interesting to click on anything there that I've prefixed Mx_....



-------------



Print Page | Close Window

Bulletin Board Software by Web Wiz Forums® version 9.69 - http://www.webwizforums.com
Copyright ©2001-2010 Web Wiz - http://www.webwiz.co.uk