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

Re: [amibroker] BARCOUNTER - Anyone having time to spare for this one?



PureBytes Links

Trading Reference Links

Try this:


Bar# = LastValue(Valuewhen(yourcondition,BarIndex(),1));

The above will give you the the bar number of the first occurance of the
event you want.

if you replace the"1" with a "2", it will give you the second (earlier)
occurance


----- Original Message ----- 
From: "Rakesh Sahgal" <rakeshsahgal@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Friday, April 01, 2005 8:12 PM
Subject: Fwd: [amibroker] BARCOUNTER - Anyone having time to spare for this
one?


>
>
> Anyone having any time to help me out with this one?
>
> TIA
>
>
> R
> --- Rakesh Sahgal <rakeshsahgal@xxxxxxxxx> wrote:
> > To: amibroker@xxxxxxxxxxxxxxx
> > From: Rakesh Sahgal <rakeshsahgal@xxxxxxxxx>
> > Date: Thu, 31 Mar 2005 09:44:29 -0800 (PST)
> > Subject: [amibroker] BARCOUNTER
> >
> > Hi group,
> >
> >
> > Quite a while back I had asked for help regarding
> > finding lowest/highest value of array between two
> > occurences of a specific condition.
> >
> > One of the members here was kind enough to help me
> > out
> > with the following indicator/function:
> >
> >
> > //*********************************************//
> > function HighestBetween(_expression,array,n)
> > {
> > e=_expression;a=array;
> > Hb=IIf(n>0,ValueWhen(e,Ref(HighestSince(e,a,1),-1),
> >     Min(LastValue(Cum(e)),n)),HighestSince(e,a));
> > return LastValue(Hb);
> > }
> > //*********************************************//
> >
> > function LOWESTBetween(_expression,array,n)
> > {
> > e=_expression;a=array;
> > Hb=IIf(n>0,ValueWhen(e,Ref(LowestSince(e,a,1),-1),
> >     Min(LastValue(Cum(e)),n)),LowestSince(e,a));
> > return LastValue(Hb);
> > }
> >
> >
> >
> >
> > X_UP=Cross(macd( ),signal());
> > X_DN=Cross(signal( ),macd( ));
> > M_Occ=Param("occ",0,0,10);
> >
> >
> >
> >
> > Low1=LOWESTBETWEEN(X_DN,L,0);
> > Low2=LowestBETWEEN(X_DN,L,1);
> >
> >
> =======================================================
> >
> >
> > For quite sometime I have been trying to find the
> > respective bar # on which those two occurences took
> > place. To the extent I could I tried everything but
> > all my efforts bombed. So here is my request - How
> > can
> > we find the bar# on which the condition was
> > satisifed
> > i.e. the bar# of low1 and low2?
> >
> > Thanks in advance for any help.
> >
> > Regards
> >
> >
> > Rakesh
> >
> >
> >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Mail - You care about security. So do we.
> > http://promotions.yahoo.com/new_mail
> >
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Personals - Better first dates. More second dates.
> http://personals.yahoo.com
>
>
>
>
> Please note that this group is for discussion between users only.
>
> To get support from AmiBroker please send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> For other support material please check also:
> http://www.amibroker.com/support.html
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>




------------------------ Yahoo! Groups Sponsor --------------------~--> 
What would our lives be like without music, dance, and theater?
Donate or volunteer in the arts today at Network for Good!
http://us.click.yahoo.com/Tcy2bD/SOnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

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

<*> 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/