[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [amibroker] Simplified support resistance levels



PureBytes Links

Trading Reference Links




So now getting myself 
organised, and probably everyone bored :)
I have now reorganised the 
formula into a loop which makes it simpler
Any comments / 
suggestions?
 

//RETRACEMENTS TO FIND VOLATILITY<SPAN 
class=786235905-15102003> / PIVOT POINTS
//Graham Kavanagh 15 Oct 2003<FONT 
size=2>
Line1 = MA<FONT 
size=2>(Avg<FONT 
size=2>,10);
Line2 = MA<FONT 
size=2>(Line1,5<FONT 
size=2>);
RT = Line1 > Line2; //rising 
trend
FT = Line1 < Line2; //falling 
trend
top = 0;
bot = 0<FONT 
size=2>;
for( i=<FONT color=#ff00ff 
size=2>2; i<<FONT color=#ff0000 
size=2>BarCount-<FONT color=#ff00ff 
size=2>1; i++ )
{
if( ( 
H<FONT 
size=2>[i]>=H<FONT 
size=2>[i-2] 
&& H<FONT 
size=2>[i]>=H<FONT 
size=2>[i-1] 
&& H<FONT 
size=2>[i]>H<FONT 
size=2>[i+1] ) 
OR ( 
L<FONT 
size=2>[i]>L<FONT 
size=2>[i-1] 
&& H<FONT 
size=2>[i]<=H<FONT 
size=2>[i-1] 
&& H<FONT 
size=2>[i]>=H<FONT 
size=2>[i+1] 
&& H<FONT 
size=2>[i]>H<FONT 
size=2>[i+2] ) 
)
{
top[i] = 1;
}
{
if( ( 
L<FONT 
size=2>[i]<L<FONT 
size=2>[i-2] 
&& L<FONT 
size=2>[i]<=L<FONT 
size=2>[i-1] 
&& L<FONT 
size=2>[i]<L<FONT 
size=2>[i+1] ) 
OR ( 
H<FONT 
size=2>[i]<H<FONT 
size=2>[i-1] 
&& L<FONT 
size=2>[i]>=L<FONT 
size=2>[i-1] 
&& L<FONT 
size=2>[i]<=L<FONT 
size=2>[i+1] 
&& L<FONT 
size=2>[i]<L<FONT 
size=2>[i+2] ) 
)
{
bot[i] = 1;
}
}
}
//Indicator section
GraphXSpace=<FONT color=#ff00ff 
size=2>5;
Plot( <FONT color=#ff0000 
size=2>C, <FONT color=#8b0000 
size=2>"C", <FONT color=#ff0000 
size=2>colorLightGrey, <FONT color=#ff0000 
size=2>styleBar+<FONT color=#ff0000 
size=2>styleNoLabel );<FONT color=#0000ff 
size=2>
PlotShapes( rt * top * <FONT color=#ff0000 
size=2>shapeSmallDownTriangle , <FONT 
color=#ff0000 size=2>colorRed, <FONT 
color=#ff00ff size=2>0, <FONT color=#ff0000 
size=2>H, -<FONT color=#ff00ff 
size=2>10);
PlotShapes( rt * bot * <FONT color=#ff0000 
size=2>shapeSmallUpTriangle , <FONT 
color=#ff0000 size=2>colorGreen , <FONT 
color=#ff00ff size=2>0, <FONT color=#ff0000 
size=2>L, -<FONT color=#ff00ff 
size=2>10);
PlotShapes( ft * top * <FONT color=#ff0000 
size=2>shapeHollowSmallDownTriangle, <FONT 
color=#ff0000 size=2>colorRed, <FONT 
color=#ff00ff size=2>0, <FONT color=#ff0000 
size=2>H, -<FONT color=#ff00ff 
size=2>10);
PlotShapes( ft * bot * <FONT color=#ff0000 
size=2>shapeHollowSmallUpTriangle, <FONT 
color=#ff0000 size=2>colorGreen , <FONT 
color=#ff00ff size=2>0, <FONT color=#ff0000 
size=2>L, -<FONT color=#ff00ff 
size=2>10);
Title = <FONT color=#0000ff 
size=2>Name()+", 
"+<FONT color=#0000ff 
size=2>Date()+ ": 
Volatility, Red = peaks, blue = troughs, solid uptrend, hollow downtrend: 
";
 
 
Cheers,Graham<A 
href="">http://groups.msn.com/ASXShareTrading<A 
href="">http://groups.msn.com/FMSAustralia 


  
  <FONT 
  face=Tahoma size=2>-----Original Message-----From: Graham 
  [mailto:gkavanagh@xxxxxxxxxxxxx] Sent: Tuesday, 14 October 2003 
  9:19 PMTo: amibroker@xxxxxxxxxxxxxxxSubject: RE: 
  [amibroker] Simplified support resistance levels
  Thanks 
  Harvey, I was aware of that but I like to try and create things for 
  myself to see if I can do it or not. Plus in order to find the maximum 
  excursion of price from the MA you almost need to wait for hte price and MA to 
  cross. That to me for my purposes too late to wait for.
   
  I have been trying a few 
  things and have gotten it into a state of trying to have sets of points for 
  rising and falling trends. I have used a very simple trend identifier to get 
  the exercise working correctly.
  <FONT 
face=Arial> 
  I think it may be able to 
  be done much simpler with a loop, but have not yet worked that one out. I have 
  also tried to remove excess signals when there are concurrent signals the 
  same. Not completely successful with that either.
  <FONT 
face=Arial> 
  Here is the code so far, 
  any suggestions appreciated 
   
  
  //RETRACEMENTS TO FIND VOLATILITY
  //Graham Kavanagh 10 Oct 2003<FONT 
  color=#008000 size=2>
  //Trend direction
  Line1 = MA<FONT 
  size=2>(Avg<FONT 
  size=2>,10);
  Line2 = MA<FONT 
  size=2>(Line1,5<FONT 
  size=2>);
  //Plot( Line1, "AVG10", colorGreen, styleLine);
  //Plot( Line2, "AVG30", colorBrown, styleLine);
  Trend1 = Line1 > Line2; //rising 
  trend
  Trend2 = Line1 < Line2; //falling 
  trend
  //Find turning points
  top1 = ( H<FONT 
  size=2>==HHV<FONT 
  size=2>(H<FONT 
  size=2>,5) 
  AND 
  H<FONT 
  size=2>>Ref<FONT 
  size=2>(H<FONT 
  size=2>,1) 
  AND 
  H<FONT 
  size=2>>=Ref<FONT 
  size=2>(H<FONT 
  size=2>,-1<FONT 
  size=2>)AND 
  H<FONT 
  size=2>>=Ref<FONT 
  size=2>(H<FONT 
  size=2>,-2) ) * 
  Trend1;//rising trend<FONT 
size=2>
  bot1 = ( L<FONT 
  size=2><=Ref<FONT 
  size=2>(L<FONT 
  size=2>,-2) 
  AND 
  L<FONT 
  size=2><=Ref<FONT 
  size=2>(L<FONT 
  size=2>,-1) 
  AND 
  L<FONT 
  size=2><Ref<FONT 
  size=2>(L<FONT 
  size=2>,1) ) * 
  Trend1;//rising trend<FONT 
size=2>
  topcheck1 = Flip<FONT 
  size=2>(top1,bot1);
  botcheck1 = Flip<FONT 
  size=2>(bot1,top1);
  Hpiv1 = ValueWhen<FONT 
  size=2>(top1,H<FONT 
  size=2>);
  Lpiv1 = ValueWhen<FONT 
  size=2>(bot1,L<FONT 
  size=2>);
  top1 = top1 OR 
  ( H<FONT 
  size=2>>Ref<FONT 
  size=2>(H<FONT 
  size=2>,1) 
  AND 
  H<FONT 
  size=2>>=Ref<FONT 
  size=2>(H<FONT 
  size=2>,-1) ) * 
  trend1 * botcheck1 * Hpiv1><FONT color=#0000ff 
  size=2>Ref(Hpiv1,-<FONT color=#ff00ff 
  size=2>1) ;
  bot1 = bot1 OR 
  ( L<FONT 
  size=2><=Ref<FONT 
  size=2>(L<FONT 
  size=2>,-1) 
  AND 
  L<FONT 
  size=2><Ref<FONT 
  size=2>(L<FONT 
  size=2>,1) ) * 
  Trend1 * topcheck1;// * 
  Lpiv1<Ref(Lpiv1,-1);
  Hpiv1 = ValueWhen<FONT 
  size=2>(top1,H<FONT 
  size=2>);
  Lpiv1 = ValueWhen<FONT 
  size=2>(bot1,L<FONT 
  size=2>);
  top2 = ( H<FONT 
  size=2>>=Ref<FONT 
  size=2>(H<FONT 
  size=2>,-2) 
  AND 
  H<FONT 
  size=2>>=Ref<FONT 
  size=2>(H<FONT 
  size=2>,-1) 
  AND 
  H<FONT 
  size=2>>Ref<FONT 
  size=2>(H<FONT 
  size=2>,1) ) * 
  Trend2;//falling trend<FONT 
  size=2>
  bot2 = ( L<FONT 
  size=2>==LLV<FONT 
  size=2>(L<FONT 
  size=2>,5) 
  AND 
  L<FONT 
  size=2><Ref<FONT 
  size=2>(L<FONT 
  size=2>,1<FONT 
  size=2>)AND 
  L<FONT 
  size=2><=Ref<FONT 
  size=2>(L<FONT 
  size=2>,-1) 
  AND 
  L<FONT 
  size=2><=Ref<FONT 
  size=2>(L<FONT 
  size=2>,-2) ) * 
  Trend2;//falling trend<FONT 
  size=2>
  topcheck2 = Flip<FONT 
  size=2>(top2,bot2);
  botcheck2 = Flip<FONT 
  size=2>(bot2,top2);
  top2 = top2 OR 
  ( H<FONT 
  size=2>>Ref<FONT 
  size=2>(H<FONT 
  size=2>,1) 
  AND 
  H<FONT 
  size=2>>=Ref<FONT 
  size=2>(H<FONT 
  size=2>,-1) ) * 
  trend2 * botcheck2;
  bot2 = bot2 OR 
  ( L<FONT 
  size=2><=Ref<FONT 
  size=2>(L<FONT 
  size=2>,-1) 
  AND 
  L<FONT 
  size=2><Ref<FONT 
  size=2>(L<FONT 
  size=2>,1) ) * 
  Trend2 * topcheck2;
  Hpiv2 = ValueWhen<FONT 
  size=2>(top2,H<FONT 
  size=2>);
  Lpiv2 = ValueWhen<FONT 
  size=2>(bot2,L<FONT 
  size=2>);
  top = top1 OR 
  top2;
  bot = bot1 OR 
  bot2;
  Hpiv = ValueWhen<FONT 
  size=2>(top,H<FONT 
  size=2>);
  Lpiv = ValueWhen<FONT 
  size=2>(bot,L<FONT 
  size=2>);
  //Indicator section<FONT 
  color=#ff0000 size=2>
  GraphXSpace=<FONT color=#ff00ff 
  size=2>5;
  Plot( <FONT color=#ff0000 
  size=2>C, <FONT color=#8b0000 
  size=2>"C", <FONT color=#ff0000 
  size=2>colorLightGrey, <FONT color=#ff0000 
  size=2>styleBar+<FONT color=#ff0000 
  size=2>styleNoLabel );<FONT 
  color=#0000ff size=2>
  PlotShapes( top1 * <FONT color=#ff0000 
  size=2>shapeSmallDownTriangle , <FONT 
  color=#ff0000 size=2>colorRed, <FONT 
  color=#ff00ff size=2>0, <FONT color=#ff0000 
  size=2>H, -<FONT color=#ff00ff 
  size=2>10);
  PlotShapes( bot1 * <FONT color=#ff0000 
  size=2>shapeSmallUpTriangle , <FONT 
  color=#ff0000 size=2>colorGreen , <FONT 
  color=#ff00ff size=2>0, <FONT color=#ff0000 
  size=2>L, -<FONT color=#ff00ff 
  size=2>10);
  PlotShapes( top2 * <FONT color=#ff0000 
  size=2>shapeHollowSmallDownTriangle, <FONT 
  color=#ff0000 size=2>colorRed, <FONT 
  color=#ff00ff size=2>0, <FONT color=#ff0000 
  size=2>H, -<FONT color=#ff00ff 
  size=2>10);
  PlotShapes( bot2 * <FONT color=#ff0000 
  size=2>shapeHollowSmallUpTriangle, <FONT 
  color=#ff0000 size=2>colorGreen , <FONT 
  color=#ff00ff size=2>0, <FONT color=#ff0000 
  size=2>L, -<FONT color=#ff00ff 
  size=2>10);
  //Plot( Hpiv, "topH",colorRed, styleStaircase);
  //Plot( Lpiv, "botL",colorBlue, styleStaircase);<FONT 
  size=2>
  Title = <FONT color=#0000ff 
  size=2>Name()+", 
  "+<FONT color=#0000ff 
  size=2>Date()+ ": 
  Volatility, Red = peaks, blue = troughs, solid uptrend, hollow 
  downtrend" ;
   
  Cheers,Graham<A 
  href="">http://groups.msn.com/ASXShareTrading<A 
  href="">http://groups.msn.com/FMSAustralia 
  
  
    
    <FONT 
    face=Tahoma size=2>-----Original Message-----From: harveyhp 
    [mailto:harveyhp@xxxxxxx] Sent: Sunday, 12 October 2003 1:40 
    PMTo: amibroker@xxxxxxxxxxxxxxxSubject: RE: 
    [amibroker] Simplified support resistance 
    levelsGraham,Don't know if this is any help, but 
    there was a TAS&C article (by Alex Saita?) a few years ago in which he 
    used a moving average of the close to separate the high and low 
    points.  Pivot highs were the highest point above the MA and vice versa 
    for the pivot lows.  Pivot highs and lows would always 
    alternate.HHP===================At 05:24 PM 11/10/2003, you 
    wrote:
    Gary, funny 
      thing is I was just about to click on the reply button when your email 
      came through.I wish I was really good at AFL, but I still just do the 
      simple methods. Too much complexity tends to bamboozle me easily these 
      days :) I think it all comes down to 
      how you define a pivot point. I just tried it by one method. I don't 
      believe you could ever say that a certain bar is a pivot until the 
      subsequent bars move in the opposite direction. So by my understanding 
      referencing future is necessary when finding them. Sorry probably off the 
      track with your query. It would be 
      possible to have, say a pivot high, but no corresponding following pivot 
      low. An example that comes to mind is you may get a high then a few 
      consecutive inside days before the price continues up. This would create a 
      pivot high, but no real pivot low, just a short 
      congestion. I have been doodling with 
      various scenarios for defining pivot points and have added one to my 
      definition, code below (I have also changed the title of the code to 
      better reflect what it is finding, or trying to find)<FONT 
      color=#008000 size=2>//<FONT face="Courier New, Courier" 
      color=#008000 size=2>PIVOT POINTS<FONT 
      color=#008000>//Graham Kavanagh 11 Oct 2003//Find turning 
      pointstop = ( H==<FONT 
      color=#0000ff>HHV(H,<FONT 
      color=#ff00ff>3) AND <FONT 
      color=#ff0000>H>=<FONT 
      color=#0000ff>Ref(H,<FONT 
      color=#ff00ff>1) AND <FONT 
      color=#ff0000>H>=<FONT 
      color=#0000ff>Ref(H,<FONT 
      color=#ff00ff>2) )<FONT 
      color=#ff0000>OR ( <FONT 
      color=#ff0000>H==HHV(<FONT 
      color=#ff0000>H,3) <FONT 
      color=#ff0000>AND <FONT 
      color=#ff0000>H>=<FONT 
      color=#0000ff>Ref(H,<FONT 
      color=#ff00ff>1) AND <FONT 
      color=#0000ff>Ref(O,<FONT 
      color=#ff00ff>1)><FONT 
      color=#0000ff>Ref(C,<FONT 
      color=#ff00ff>1) );bot = ( <FONT 
      color=#ff0000>L==LLV(<FONT 
      color=#ff0000>L,3) <FONT 
      color=#ff0000>AND <FONT 
      color=#ff0000>L<<FONT 
      color=#0000ff>Ref(L,<FONT 
      color=#ff00ff>1) AND <FONT 
      color=#ff0000>L<<FONT 
      color=#0000ff>Ref(L,<FONT 
      color=#ff00ff>2) )<FONT 
      color=#ff0000>OR ( <FONT 
      color=#ff0000>L==LLV(<FONT 
      color=#ff0000>L,3) <FONT 
      color=#ff0000>AND <FONT 
      color=#ff0000>L<=<FONT 
      color=#0000ff>Ref(L,<FONT 
      color=#ff00ff>1) AND <FONT 
      color=#0000ff>Ref(C,<FONT 
      color=#ff00ff>1)><FONT 
      color=#0000ff>Ref(O,<FONT 
      color=#ff00ff>1) );//Calculate 
      movement between turning pointstopH = <FONT 
      color=#0000ff>ValueWhen(top,<FONT 
      color=#ff0000>H);botL = <FONT 
      color=#0000ff>ValueWhen(bot,<FONT 
      color=#ff0000>L);moveup = <FONT 
      color=#0000ff>Ref(botL,-<FONT 
      color=#ff00ff>1)<botL;movedown = <FONT 
      color=#0000ff>Ref(topH,-<FONT 
      color=#ff00ff>1)>topH;diffup = <FONT 
      color=#0000ff>IIf( moveup, botL - <FONT 
      color=#0000ff>ValueWhen( moveup, topH ), <FONT 
      color=#ff0000>Null);diffdown = <FONT 
      color=#0000ff>IIf( movedown, topH- <FONT 
      color=#0000ff>ValueWhen( movedown, botL ), <FONT 
      color=#ff0000>Null);//Indicator 
      sectionGraphXSpace=<FONT 
      color=#ff00ff>5;<FONT 
      color=#0000ff>Plot( C, 
      "C", <FONT 
      color=#ff0000>colorLightGrey, <FONT 
      color=#ff0000>styleBar+<FONT 
      color=#ff0000>styleNoLabel );<FONT 
      color=#0000ff>PlotShapes( (<FONT 
      color=#ff0000>shapeHollowSmallCircle+<FONT 
      color=#ff0000>shapePositionAbove)*top, <FONT 
      color=#ff0000>colorRed, 0, 
      H );<FONT 
      color=#0000ff>PlotShapes( (<FONT 
      color=#ff0000>shapeHollowSmallCircle)*bot, <FONT 
      color=#ff0000>colorBlue , <FONT 
      color=#ff00ff>0, <FONT 
      color=#ff0000>L);<FONT 
      color=#ff0000>Title = <FONT 
      color=#0000ff>Name()+" 
      "+Date()+ <FONT 
      color=#8b0000>" Volatility, Red dots = peaks, blue = 
      troughs" + ", down move = 
      "+ diffup + ", up move = 
      " + diffdown + ", High = " + 
      H + ", Low = 
      " + <FONT 
      color=#ff0000>L;  <FONT 
      size=2>Cheers,Graham<A 
      href="">http://groups.msn.com/ASXShareTrading<A 
      href="" 
      eudora="autourl">http://groups.msn.com/FMSAustralia 
      
        -----Original Message-----
        From: Gary A. Serkhoshian [<A 
        href="" 
        eudora="autourl">mailto:serkhoshian777@xxxxxxxxx] 
        Sent: Saturday, 11 October 2003 1:39 AM
        To: amibroker@xxxxxxxxxxxxxxx
        Subject: RE: [amibroker] Simplified support resistance 
        levels
        Graham,
          
        Just thinking about the looking into the future issue.  How 
        could it be possible to break the pivot high level while still forming 
        and the pivot high condition still be true.  It does not seem to be 
        possible.
          
        Any thoughts?  Just want to put this to bed.
          
        Regards,
        Gary
        Graham <gkavanagh@xxxxxxxxxxxxx> wrote:
        Thanks for that Gary, gives me something to try to work them 
        out, and
        whether I need them.
        Further to this simple support/resistance formula I am looking at it 
        to work
        out what the retracements are during trends. I am just starting 
        putting this
        together and look for any input to help simplify or enhance. I see 
        this as
        being used to determine box sizes for P&F charts, swing points 
        and setting
        trailing stop levels to name a few.
        Here is what I have so far
        //RETRACEMENTS TO FIND VOLATILITY
        //Graham Kavanagh 10 Oct 2003
        //Find turning points
        top = H==HHV(H,3) AND H>=Ref(H,1) AND H>=Ref(H,2);
        bot = L==LLV(L,3) AND L<=Ref(L,1) AND L<=Ref(L,2);
        //Calculate movement between turning points
        topH = ValueWhen(top,H);
        botL = ValueWhen(bot,L);
        moveup = Ref(botL,-1)<botL;
        movedown = Ref(topH,-1)>topH;
        diffup = IIf( moveup, botL - ValueWhen( moveup, topH ), Null);
        diffdown = IIf( movedown, topH- ValueWhen( movedown, botL ), 
        Null);
        //Indicator section
        GraphXSpace=5;
        Plot( C, "C", colorLightGrey, styleBar+styleNoLabel );
        PlotShapes( (shapeHollowSmallCircle+shapePositionAbove)*top, 
        colorRed, 0, H
        );
        PlotShapes( (shapeHollowSmallCircle)*bot, colorBlue , 0, L);
        Plot(diffup, "diffup", colorAqua, 
        styleHistogram+styleLeftAxisScale);
        Plot(diffdown, "diffdown", colorLime, 
        styleHistogram+styleLeftAxisScale);
        Plot(0, "0", colorBlack, styleLine+styleLeftAxisScale);
        Title = Name()+" "+Date()+ " Volatility, Red dots = peaks, blue = 
        troughs" +
        ", down move = " + diffup + ", up move = " + diffdown + ", High = " 
        + H + ",
        Low = " + L;
        Cheers,
        Graham
        <A 
        href="">http://groups.msn.com/ASXShareTrading
        <A href="" 
        eudora="autourl">http://groups.msn.com/FMSAustralia
        -----Original Message-----
        From: Gary A. Serkhoshian [<A href="" 
        eudora="autourl">mailto:serkhoshian777@xxxxxxxxx] 
        Sent: Friday, 10 October 2003 12:41 PM
        To: amibroker@xxxxxxxxxxxxxxx
        Subject: RE: [amibroker] Simplified support resistance 
        levels
        Hi Graham,
        I forgot to include the PivotLow function on the last send.  
        Both are below.
        You'd use the functions like this:
        #pragma nocache
        #include "Wherever you put your afl file with the functions"
        PH = PivotHigh(3,3); PL = PivotLow(3,3);
        Plot( C, "C", colorLightGrey, styleBar+styleNoLabel );
        Plot( PH, "res", colorRed, styleDots+styleNoLine );
        Plot( PL, "sup", colorGreen, styleDots+styleNoLine );
        Title = Name() + ", " + Date() + ", Support & Resistance Levels 
        Support = "
        + PH + ", Resistance = " + PL ;
        If you are using functions embedded in your afl, make sure they are 
        above
        the code that actually calls them.
        e.g.  
        Function Blah(Len);
        {
        return MoreBlah;
        }
        BL = Blah(5);
        Plot(BL,"BL",colordefault,styleline);
        Hope this helps,
        Gary
        CODE BELOW FOR THE PIVOT LOW/HI FUNCTIONS
        //===== PivotHigh(LeftStr, RightStr) 
        ====================================
        /*
        SUPPORT & RESISTANCE LEVELS
        Graham Kavanagh 9 Oct 2003
        Returns High value of pivot
        */
        function PivotHigh(LeftStr, RightStr)
        {
        //Find turning points
        top = H == HHV(H,LeftStr+1) AND H == Ref(HHV(H,RightStr+1), 
        RightStr);
        topH = ValueWhen(top,H);
        return topH;
        }
        //======= PivotLow(LeftStr, RightStr) 
        ====================================
        /*
        SUPPORT & RESISTANCE LEVELS
        Graham Kavanagh 9 Oct 2003
        Returns Low value of pivot
        */
        function PivotLow(LeftStr, RightStr)
        {
        //Find turning points
        BOT = L == LLV(L,LeftStr+1) AND L == Ref(LLV(L,RightStr+1), 
        RightStr);
        BOTL = ValueWhen(BOT,L);
        return BOTL;
        }
        Graham <gkavanagh@xxxxxxxxxxxxx> wrote:
        Thanks Gary 
        That makes it interesting as I have not yet tried the function 
        function :) 
        Do you just put the numbers you want into the intital function 
        setting 
        Eg  
        function PivotHigh(2, 4)
        Cheers,
        Graham
        <A 
        href="">http://groups.msn.com/ASXShareTrading
        <A href="" 
        eudora="autourl">http://groups.msn.com/FMSAustralia
        -----Original Message-----
        From: Gary A. Serkhoshian [<A href="" 
        eudora="autourl">mailto:serkhoshian777@xxxxxxxxx] 
        Sent: Friday, 10 October 2003 11:43 AM
        To: amibroker@xxxxxxxxxxxxxxx
        Subject: Re: [amibroker] Simplified support resistance 
        levels
        Hi Graham,
        I just added the ability to have variable right and left strength 
        and
        converted into a function.  Hope this saves you some work, and 
        thanks for
        all the posts and code you've contributed.
        Regards,
        Gary
        //==========  PivotHigh(LeftStr, RightStr)  
        ============================
        /*
        SUPPORT & RESISTANCE LEVELS
        Graham Kavanagh 9 Oct 2003
        Returns High value of pivot
        */
        function PivotHigh(LeftStr, RightStr)
        {
        //Find turning points
        top = H == HHV(H,LeftStr+1) AND H == Ref(HHV(H,RightStr+1), 
        RightStr);
        topH = ValueWhen(top,H);
        return topH;
        }
        Graham <gkavanagh@xxxxxxxxxxxxx> wrote: 
        I have been looking at various ways to chart the support resistance 
        elevels,
        ultimately to incorporate into various trading systems. Having 
        attempted
        loops and other methods of differing complexity I pulled back to 
        the
        simplest of forms, price.
        Now this is probably already shown somewhere, but will share it 
        anyway.
        Any comments appreciated
        //SUPPORT & RESISTANCE LEVELS
        //Graham Kavanagh 9 Oct 2003
        //Find turning points
        top = H==HHV(H,3) AND H>=Ref(H,1) AND H>=Ref(H,2);
        bot = L==LLV(L,3) AND L<=Ref(L,1) AND L<=Ref(L,2);
        topH = ValueWhen(top,H);
        botL = ValueWhen(bot,L);
        //Indicator section
        GraphXSpace=5;
        Plot( C, "C", colorLightGrey, styleBar+styleNoLabel );
        Plot( topH, "res", colorRed, styleDots+styleNoLine );
        Plot( botL, "sup", colorGreen, styleDots+styleNoLine );
        Title = Name() + ", " + Date() + ", Support & Resistance Levels 
        Support = "
        + topH + ", Resistance = " + botL ;
        Cheers,
        Graham
        <A 
        href="">http://groups.msn.com/ASXShareTrading
        <A href="" 
        eudora="autourl">http://groups.msn.com/FMSAustralia
        Send BUG REPORTS to bugs@xxxxxxxxxxxxx
        Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
        -----------------------------------------
        Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 

        (Web page: <A 
        href="">http://groups.yahoo.com/group/amiquote/messages/)
        --------------------------------------------
        Check group FAQ at:
        <A 
        href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
        
        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
        
        Do you Yahoo!?
        The New Yahoo! Shopping - with improved product search 
        Yahoo! Groups Sponsor
        Send BUG REPORTS to bugs@xxxxxxxxxxxxx
        Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
        -----------------------------------------
        Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 

        (Web page: <A 
        href="">http://groups.yahoo.com/group/amiquote/messages/)
        --------------------------------------------
        Check group FAQ at:
        <A 
        href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
        
        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
        
        Send BUG REPORTS to bugs@xxxxxxxxxxxxx
        Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
        -----------------------------------------
        Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 

        (Web page: <A 
        href="">http://groups.yahoo.com/group/amiquote/messages/)
        --------------------------------------------
        Check group FAQ at:
        <A 
        href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
        
        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
        
        Do you Yahoo!?
        The New Yahoo! Shopping - with improved product search 
        Yahoo! Groups Sponsor
        ADVERTISEMENT
        Send BUG REPORTS to bugs@xxxxxxxxxxxxx
        Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
        -----------------------------------------
        Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 

        (Web page: <A 
        href="">http://groups.yahoo.com/group/amiquote/messages/)
        --------------------------------------------
        Check group FAQ at:
        <A 
        href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
        
        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
        
        Send BUG REPORTS to bugs@xxxxxxxxxxxxx
        Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
        -----------------------------------------
        Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 

        (Web page: <A 
        href="">http://groups.yahoo.com/group/amiquote/messages/)
        --------------------------------------------
        Check group FAQ at: <A 
        href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
        
        Your use of Yahoo! Groups is subject to the <A 
        href="">Yahoo! Terms of 
        Service. Do you Yahoo!?<A 
      href="">The 
      New Yahoo! Shopping - with improved product search Send 
      BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
      suggest@xxxxxxxxxxxxx-----------------------------------------Post 
      AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: 
      <A 
      href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
      group FAQ at: <A 
      href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
      Your use of Yahoo! Groups is subject to the <A 
      href="">Yahoo! Terms of Service. 
      Yahoo! Groups Sponsor 
      ADVERTISEMENT<A 
      href=""><IMG 
      height=250 alt="click here" 
      src="" 
      width=300 NOSEND="1"><IMG height=1 alt=[] 
      src="" 
      width=1 NOSEND="1">Send BUG REPORTS to 
      bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
      suggest@xxxxxxxxxxxxx-----------------------------------------Post 
      AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: 
      <A 
      href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
      group FAQ at: <A 
      href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
      Your use of Yahoo! Groups is subject to the <A 
      href="">Yahoo! Terms of Service. 
    Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend 
    SUGGESTIONS to 
    suggest@xxxxxxxxxxxxx-----------------------------------------Post 
    AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: 
    <A 
    href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
    group FAQ at: <A 
    href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
    Your use of Yahoo! Groups is subject to the <A 
    href="">Yahoo! Terms of Service. 
    Send 
  BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx-----------------------------------------Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Your use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 







Yahoo! Groups Sponsor


  ADVERTISEMENT 









Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.