PureBytes Links
Trading Reference Links
|
Owen,
There are 3 different things here [with the respective AFL solutions]:
When a COND is true for many concecutive bars, we may ask
a. To remember the value of an array from the last bar the COND was
true, solved through Valuewhen(COND,array) or the equivalent
AMA(array,COND)
b. To remember the value of an array from the first bar the COND was
true, solved through Valuewhen(COND AND Ref(COND,-1)==0,array) or the
equivalent AMA(array, COND AND Ref(COND,-1)==0)
c. To remember the value of an array exclusively from the [confirmed]
last bar the COND was true, solved through
Valuewhen(COND==0 AND Ref(COND,-1),Ref(array,-1)) or the equivalent
AMA(Ref(array,-1), COND==0 AND Ref(COND,-1))
The choice depends on the question.
DT
--- In amibroker@xxxxxxxxxxxxxxx, "Owen Davies" <owen5819@xxxx> wrote:
> DIMITRIS TSOKAKIS wrote:
>
>
> > ValueWhen(Condition, Ref(HHV(H,4),-1),1) is just OK, it will hold
the
> > requested value untill the next COND occurrence.
>
> Of course. But what if he is dealing with a condition such as
StochD(14) >
> 50? In that case, the value will change every day the condition
remains
> true. Maybe I read something into his message that wasn't really
there, but
> I thought he wanted to hold the value from when the condition
became true;
> hence the extra suggestion. It's certainly a problem I run into
almost
> every time I fire up AB.
>
> Owen
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/Lj3uPC/Me7FAA/ySSFAA/GHeqlB/TM
---------------------------------------------------------------------~->
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
|