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

Re: [amibroker] Index Stock lists



PureBytes Links

Trading Reference Links

Here is the general solution

Plot(C,"",1,8);
Cond=Cross(MACD(),0); 
n=1+Cum(1)%3;//variable n
for(i=0;i<BarCount;i++)
{
Value=ValueWhen(Cond,C,n[i]);
y[i]=Value[i];
}
Plot(y,"["+WriteVal(n,1.0)+"]",1,1);
Plot(ValueWhen(Cond,C,1),"1",2,1);
Plot(ValueWhen(Cond,C,2),"2",3,1);
Plot(ValueWhen(Cond,C,3),"3",4,1);
PlotShapes(shapeUpArrow*Cond,colorBrightGreen);

Dimitris Tsokakis
--- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx> 
wrote:
> Valuewhen does not support variable N.
> In your example it is not hard to overcome this.
> 
> K14=StochK(14);
> D14=StochD(14);
> Xkd=Cross(K14,D14);
> Xdk=Cross(D14,K14);
> //N=IIf(Xkd,2,1);
> C>IIf(Xkd,ValueWhen(Xkd AND K14<60,C,2),ValueWhen(Xkd AND 
> K14<60,C,1));
> 
> Dimitris Tsokakis
> --- In amibroker@xxxxxxxxxxxxxxx, "Bob Jagow" <bjagow@xxxx> wrote:
> > What was easy to do another way, Ron?
> > 
> > -----Original Message-----
> > From: mrdavis9 [mailto:mrdavis9@x...]
> > Sent: Thursday, July 29, 2004 9:16 PM
> > To: amibroker
> > Subject: [amibroker] Valuewhen(Cond,Array,N);
> > 
> > 
> > This is an unsupported use of N.   It was easy to do it another 
way.
> > 
> > K14=StochK(14);
> > 
> > D14=StochD(14);
> > 
> > Xkd=Cross(K14,D14);
> > 
> > Xdk=Cross(D14,K14);
> > 
> > N=IIf(Xkd,2,1);
> > 
> > C>ValueWhen(Xkd AND K14<60,C,N);
> > 
> > I have found that N can be  a function such as barssince() when I 
am
> > using
> > Sum(), but apparently it cannot be a variable when used in a 
> Valuewhen()
> > situation.  Is this correct?   Ron D
> > 
> > 
> > 
> > 
> > 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



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