PureBytes Links
Trading Reference Links
|
On a quick glance, it seems to me that the retval definition is a
bit strange. Wouldn't IIF do better here?
retval=iif(groupid()==group,ir,null);
Johan
--- In amibroker@xxxxxxxxxxxxxxx, "wooziwog" <xcitemint@xxxx> wrote:
> I am trying to use parameter settings to group EW internal and
> external retracements. I have written the function in the code
below
> in an attempt to return the value only if it meets the "group"
> requirement of the function. I have tried several ways and have not
> been able to use the parameter settings to separate the retracement
> levels by group, could someone please help me.
> TIA
>
> David K.
>
> Plot( Close, "Close", 20, 64);
>
> //Progressive EW//
> RE=Study("RE",GetChartID());Plot(re,"Pr Pivot",15,8);
> SU=Study("SU",GetChartID());Plot(su,"Pr Pivot",8,8);
> x=re-su;
> //*Retracements*//
> function IER(factor,group)
> {
> ir=x*(factor)+su;
> retval=ValueWhen(group,ir,1);//return value by group
> ret=retval;
> return ret;
> }
>
> I1=Param("38,50",1,1,9,1);
> I2=Param("162,200",2,1,9,1);
>
> ir38=ier(0.382,I1);Plot(ir38,"38% Ret",colorRed);
> ir50=ier(0.50,I1);Plot(ir50,"50% Ret",colorRed);
> er162=ier(1.618,I2);Plot(er162,"162% Ret",colorRed);
> er200=ier(2.0,I2);Plot(er200,"200% Ret",colorRed);
------------------------ Yahoo! Groups Sponsor --------------------~-->
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~->
Check AmiBroker web page at:
http://www.amibroker.com/
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.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/
|