PureBytes Links
Trading Reference Links
|
Maybe not. If I'm understanding your question correctly you could use
"Flip," which I use all the time.
Example:
Cond1=Close > ref(LLV(L, 30),-1;
Cond2=C<ref(LLV(L,30),-1;
Cond3=Flip(Cond1,Cond2);
Buy=Cond3 AND Ref(Cond3,-1)==0;
Sell=Cond3==0 AND Ref(Cond3,-1);
Here's what happens, and apologies if you already get this and apologies
to better coders than me.:) The first condition defines what you're
looking for, a close higher than the lowest low of the past 30 days.
The second condition defines a situation where the close is below the
lowest low of the past 30 days. The "Flip" works sort of like a
Buy/Sell toggle switch. The "AND" references in the Buy/Sell conditions
give you one and only one signal at a time. (If you wanted to you could
use ExRem to filter out multiple signals, instead.)
I also use the below piece of code to put buy/sell signals onto a chart.
That way I can "eyeball" the signals from an indicator and make sure I'm
really getting what I want. Just paste it in at the end of the above
code.
shape=Buy*shapeUpArrow+Sell*shapeHollowDownArrow;
PlotShapes(shape,IIf(Buy, colorGreen, colorRed),0,IIf(Buy, Low,High));
Luck,
Sebastian
--- In amibroker@xxxxxxxxxxxxxxx, Sidney Kaiser <skbiker@xxx> wrote:
>
> Close > LLV(Low, 30) tells me if todays close is greater than the
lowest low in the last 30 days.
>
> What I need is to test if the close remains greater than the previous
30 day low.
>
> I am not certain, but I take this to mean the close should not go
below the previous 30 day low
> at any time during the 30 day period. Would this require a loop to
evaluate it properly?
>
> Implementation ideas?
>
> Cheers, Sid
>
Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.15.21/589 - Release Date: 12/15/2006 5:10 PM
|