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

Re: [amibroker] error corrected by graham for :support resistance formula error pls correct endless l;oop problem


  • To: amibroker@xxxxxxxxxxxxxxx
  • Subject: Re: [amibroker] error corrected by graham for :support resistance formula error pls correct endless l;oop problem
  • From: reinsley <reinsley@xxxxxxxx>
  • Date: Thu, 05 Nov 2009 10:35:38 +0100

PureBytes Links

Trading Reference Links

Graham,

Thanks for your code. Thanks to rvlv as well that as activated the topic.

Graham, if by any chance you read this post, how can we modify your 
original formula to plot only the S & R left open.

I mean by "open", a support line on a pivot (resitance line) that is not 
overlapped by a new swing ( at its right side).

ex :

A down swing hits 1000 (lower pivot) then goes up to 1500, down to 1200, 
up 1700, down 1400, up 1600, down 1300, up 1550 and last is 1450.

The idea is to plot 1000, 1500, 1200 but the swing to 1700 should remove 
the 1500 pivot line. This 1500 pivot is closed as the 1700 swing on its 
right is the new reference.

Then 1700 plot, 1400 plot ,1600 plot but down swing from 1600 to 1300 
removes the 1400 line pivot.

At the end we should plot only these lines

1700
1600
1550

1300
1200
1000

If you see any interest to this and if it's not too tricky for your 
programming skill, it will be a nice lesson and a useful tool for me.

TIA

Best regards



ram vel a écrit :
>  
> 
> 
> 
> --- On *Thu, 11/5/09, ram vel /<rvlv@xxxxxxxxx>/* wrote:
> 
> 
>     From: ram vel <rvlv@xxxxxxxxx>
>     Subject: Re: [amibroker] error is here request for :support
>     resistance formula error pls correct endless l;oop problem
>     To: amibroker@xxxxxxxxxxxxxxx
>     Date: Thursday, November 5, 2009, 12:58 AM
> 
>      
>     Thanks a lot Graham.
>     I got this code from a friend.
>     With your name there, I thought my friend made a copy paste transfer
>     error.
>     Kind of you for replying.
>     Thanks a million for your afl example-novices like me derive their
>     morale boost from your guidance
>     regards
>     rvlv
> 
>     --- On *Thu, 11/5/09, Graham /<kavemanperth@ gmail.com>/* wrote:
> 
> 
>         From: Graham <kavemanperth@ gmail.com>
>         Subject: Re: [amibroker] error is here request for :support
>         resistance formula error pls correct endless l;oop problem
>         To: amibroker@xxxxxxxxx ps.com
>         Date: Thursday, November 5, 2009, 12:50 AM
> 
>          
>         an obvious error I can see is this
>         i = numline should be i <= numline
> 
>         hope I did not write that error in the code I originally posted !
> 
>         -- 
>         Cheers
>         Graham Kav
>         AFL Writing Service
>         http://www.aflwriti ng.com <http://www.aflwriting.com/>
> 
>         2009/11/5 ram vel <rvlv@xxxxxxxxx
>         <http://us.mc342.mail.yahoo.com/mc/compose?to=rvlv@xxxxxxxxx>>
> 
> 
> 
>             Plot(ValueWhen( SupBase==Base, LLV(*L*,HHVperiod) ),
>             "Support Level",*colorGreen*);
>             line 58 col 78 
>             error 15   endless loop detected in FOR loop
> 
> 
>             --- On *Wed, 11/4/09, rvlv /<rvlv@xxxxxxxxx
>             <http://us.mc342.mail.yahoo.com/mc/compose?to=rvlv@xxxxxxxxx>>/*
>             wrote:
> 
> 
>                 From: rvlv <rvlv@xxxxxxxxx
>                 <http://us.mc342.mail.yahoo.com/mc/compose?to=rvlv@xxxxxxxxx>>
>                 Subject: [amibroker] request for :support resistance
>                 formula error pls correct endless l;oop problem
>                 To: amibroker@xxxxxxxxx ps.com
>                 <http://us.mc342.mail.yahoo.com/mc/compose?to=amibroker@xxxxxxxxxxxxxxx>
>                 Date: Wednesday, November 4, 2009, 11:49 PM
> 
>                  
>                 attn "Joris M.schuller" <jmschuller@xxxxxxxx net
>                 <http://us.mc342.mail.yahoo.com/mc/compose?to=jmschuller%40charter.net>>
>                 attn droskill
> 
>                 The following code by Don Lindberg has some looping ewrror
>                 kindly correct and post correct code
> 
>                 ============ ========= ========= ========= ========= ====
>                 //Don Lindberg
>                 //Subject: RE: [amibroker] graham Kavanagh Support AND
>                 resistance usingRSI.
>                 //Date: Tuesday, November 6, 2007, 2:19 PM
> 
>                 //I have put in basic code to allow you to run as
>                 exploration. You can narrow
>                 //your search by changing the criteria in the Filter
>                 Statement.
> 
>                 //---------- -- --------- ------ Begin Code ------------
>                 --------- ---
> 
>                 _SECTION_BEGIN( "support and resistant");
> 
>                 //Support and resistance levels using RSI.
> 
>                 //graham Kavanagh May 2003
> 
>                 //Load into Indicator Builder
> 
>                 //Sensitivity of the levels can be changed with the
>                 variables
> 
>                 //Can test different numbers live with the Param
>                 function ctrl-R with Openpane
> 
>                 RSIperiod = 5; // Param("RSI p",3,14,30,1) ;
> 
>                 Percent = 5; // Param("ZIG %",8,9,15,1) ;
> 
>                 EMAperiod = 5; //Param("EMA p",4,5,10,1) ;
> 
>                 HHVperiod = 5; //Param("HHV p",3,5,10,1) ;
> 
>                 NumLine = 1; //Param("Num Lines",3,1,20, 1);
> 
>                 Base = DEMA(RSI(RSIperiod) , EMAperiod) ;
> 
>                 GraphXSpace= 0.5;
> 
>                 Plot(C,"",colorBlac k,styleCandle) ;
> 
>                 for( i = 1; i = numline; i++ )
> 
>                 {
> 
>                 ResBase = LastValue(Peak( Base,Percent, i));
> 
>                 SupBase = LastValue(Trough( Base,Percent, i));
> 
>                 Plot(ValueWhen( ResBase==Base, HHV(H,HHVperiod) ),
>                 "Resist Level",
> 
>                 colorRed, styleLine);
> 
>                 Plot(ValueWhen( SupBase==Base, LLV(L,HHVperiod) ),
>                 "Support Level",colorGreen) ;
>                 }
> 
>                 Title = Name() + "; " + Date() + ": Support Resistance
>                 Levels using
> 
>                 RSI: " + /*EncodeColor( colorGreen) + "Support Levels
>                 are Green;
> 
>                 "+EncodeColor( colorRed) + "Resistance Levels are Red:
> 
>                 "+EncodeColor( colorBlack) +*/ "Num lines ="+WriteVal(
>                 numline, 1) ;
> 
>                 Filter=C>10 AND C>75 AND ResBase>=1 AND SupBase >=1;
> 
>                 Buy=Sell=Short= Cover=0;
> 
>                 AddColumn(C, "Close",1. 2);
> 
>                 AddColumn(ResBase, "Resistance" ,1.2);
> 
>                 AddColumn(SupBase, "Support" ,1.2);
> 
>                 _SECTION_END( );
> 
>                 ============ ========= ========= ========
> 
>                 THANKS IN ADVANCE TO ALL FOR HELP
> 
> 
> 
> 
> 
> 
> 



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

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    amibroker-digest@xxxxxxxxxxxxxxx 
    amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/