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

[amibroker] Help with ExRem vs Flip



PureBytes Links

Trading Reference Links

In searching past messages, I found this explanation, confirmed by
experts:

Flip is saying:

"Return True at First Occurence of Array1 and continue to do so, 
until Array 2 is true."

... while ExRem is saying:

"Return True at First Occurence ONLY of Array 1 and false thereafter, 
until Array 2 is true."

In other words, one might think of ExRem as "Notification of First 
occurence ONLY of a True condition, with a separate reset condition."

...and Flip as "Continuing notification of a once-True condition, 
until a separate reset condition."

I have a simple test code and plot, trying to Buy when Williams%R
indicator goes above -20 and sell when it crosses below -80 (just
selected this for test).  As the indicator is quite "jerky", it can go
above and below the cross values before getting to the other one, and I
want to signal just the first cross.

So, I wrote the following little code:

x=Param("x",25,2,25);
R = ((HHV(H,x) - C) /(HHV (H,x) -LLV (L,x))) *-100;
Buy=Cross(R,-80);
PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),5,0,R,-14);
Plot(R,"%WilliamsR",6,4);
Sell=Cross(-20,R);
ExRem(Buy,Sell);
ExRem(Sell,Buy);
PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),4,0,R,-14);
Plot(-20,"",7,1);
Plot(-80,"",7,1); 
GraphXSpace=10;

Which produces the plot in the attached.  The circled red and green
arrows seem like they should be eliminated by the ExRem statements
according to the above definition.   The plot shows this is not the
case.

What am I missing?

Ken

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Rent DVDs from home.
Over 14,500 titles. Free Shipping
& No Late Fees. Try Netflix for FREE!
http://us.click.yahoo.com/BVVfoB/hP.FAA/uetFAA/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/ 


Attachment:
A1.gif

Attachment: Description: "Description: GIF image"