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

Re: [amibroker] commodities data?



PureBytes Links

Trading Reference Links

It cannot be a variable and should be converted to a distinct number. Ie
N=IIf(LastValue(Xkd),2,1);

This sounds bad if you want to do backtesting, but if you use a loop for
testing the last value, I think, then relates to the last value at bar [i]
K14=StochK(14);

D14=StochD(14);

Xkd=Cross(K14,D14);

Xdk=Cross(D14,K14);

N=IIf(LastValue(Xkd),2,1);

Buy = C>ValueWhen(Xkd AND K14<60,C,N);

For ( i=1;i<barcount;i++)
{  buy[i] ;}

Cheers,
Graham
http://e-wire.net.au/~eb_kavan/

-----Original Message-----
From: mrdavis9 [mailto:mrdavis9@xxxxxxxxxx] 
Sent: Friday, July 30, 2004 12: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/