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

[amibroker] How to code this simple problem?



PureBytes Links

Trading Reference Links

How do you define a variable that will, upon a condition met, take the 
current value but if the condition is not met then it will keep using 
the value it has?

So let's say I have a signal for a new 10 day High [H==hhv(H,10)]. Upon 
the signal you check if this new 10 day high is higher than the last 10 
day high value. If it is then you accept the new value if not then you 
use the previous one.

Example: price makes a 10 day high at 100 then falls for 20 days to $50 
then makes a new 10 day high at $60. How do I make a variable that will 
keep the 100 value until a new 10 day high exceeds 100?

It seems like ama2 might help but I can't figure it out.

Thanks!





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.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/