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

Re: [amibroker] simplest way to detect a reversal of direction in an indicator



PureBytes Links

Trading Reference Links

Lets say that I want to trigger a sell when a moving average (or any
indicator) has fallen 4% from its recent peak...

A1=MA(C,14);
Z1=ValueWhen(Cross(HHV(A1,14),A1),A1);
S1= Cross(Z1-(Z1*0.04),A1);
Plot(C,"Close",colorBlue,1);
Plot(A1,"MA",colorRed,1);//our indicator
Plot(S1,"S1",colorGreen,1|styleOwnScale);//4% fall Trigger Signal
Plot(Z1,"last peak",colorLightBlue,1);//shows where our last peak was at

This isn't the only way and this way has problems if there is a series of
declining peaks.

-CS

----- Original Message ----- 
From: Dave Merrill
To: AmiBroker
Sent: Monday, August 25, 2003 5:31 AM
Subject: [amibroker] simplest way to detect a reversal of direction in an
indicator


what's the simplest way to detect a change of direction in some indicator by
more than a certain amount? it's easy to see on a chart, you just look for
peaks, and find the places where the indicator has moved the required amount
from there.

I have a working version that requires crossing an absolute level first,
before the change in direction will be honored. that's doable because you
can use HighestSince(AbsoluteLevelCrossed), but I can't see how to build a
similar thing without that absolute level crossover. what you really mean is
HighestSince(CrossoverInTheOppositeDirection), but that makes the level your
looking for dependant on the crossovers that came before it.

you could step through the indicator array one bar at a time to do this, but
it seems like there's got to be a better way.

any ideas? is my question clear?

thanks,

Dave Merrill


Yahoo! Groups Sponsor
ADVERTISEMENT




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 the Yahoo! Terms of Service.


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/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/