Dynamic Support & Resistance |
Post Reply |
Author | |
maximo
BullCharts Guru Joined: 02 Sep 2006 Location: Australia Posts: 232 |
Post Options
Quote Reply
Topic: Dynamic Support & Resistance 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);Edited by maximo - 28 Oct 2010 at 1:16pm |
|
cudderbean
Regular Joined: 02 Oct 2006 Location: Thailand Posts: 40 |
Post Options Quote Reply Posted: 08 Nov 2010 at 1:05pm |
Thanks, Maximo, for yet another generous contribution.
|
|
maximo
BullCharts Guru Joined: 02 Sep 2006 Location: Australia Posts: 232 |
Post Options Quote Reply 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;Edited by maximo - 09 Nov 2010 at 12:50pm |
|
cudderbean
Regular Joined: 02 Oct 2006 Location: Thailand Posts: 40 |
Post Options Quote Reply 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_.... |
|
Post Reply |
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |