Hello,
maybe the code below makes what you are trying to do:
BuyStop = ValueWhen(L == LLV(L,10),H,1);
Plot(C, "C", colorLightBlue, 128);
Plot(BuyStop, "BuyStop", colorGreen, 1);
Kind regards
Thomas
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of cipherscribe
Sent: Friday, December 28, 2007 11:00 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Finding a valuewhen
Hi There,
I'm not sure if I am doing this right, but I am trying to code into a
variable a high value when price drops to it's llv in 10 periods. For
example:
Buystop = ValueWhen(LLV(L,10),H,1);
The only problem with this is that the variable stores the High for
the last bar. I need to know the value of the high when price reached
it's LLV.
I have also tried:
Buystop = lastvalue(ValueWhen(LLV(L,10),H,1));
but that simply gives me the high of the last bar also.
I am not a great coder, but I think this has to do with the entire
high array being passed to the variable. How do I store just one value
- the one I need?
Do I need some looping here?
__._,_.___