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

Re: AFL question: confirming a signal



PureBytes Links

Trading Reference Links

Thank you,

That was helpful.
This is what I finally made up:

BuySig = ...my buying rule...
Buy = Hold(BuySig,5) AND BuyPrice > ValueWhen(Buysig, H, 1);
BuyPrice = (ValueWhen(Buysig, H, 1)) + 0.01;
Buy = ExRemSpan(Buy, 4 );

Works fine.
(I.e. does what I wanted in 4.07beta. Strangely in 4.00 - working 
from the same database - I found 1 arrow 1 bar too late.)
BTW if there's another way of doing this I'd be interested to learn. 

I also wonder if it is possible to have two buy arrows in two shades 
of green, one for the "BuySig" signal and one for the actual 
confirmed "Buy". Not that I desperately need it, just out of 
curiosity.

allm4m.




--- In amibroker@xxxx, "Sharps_45_70" <sharps_45_70@xxxx> wrote:
> allm4m,
> 
> Take a look at the "Hold" function.
> 
> Ed
> 
> --- In amibroker@xxxx, "allm4m" <allm4m@xxxx> wrote:
> > Hello,
> > 
> > I want to follow a buy signal only when it's confirmed by the 
price 
> > rising above the High of the bar when the signal was originally 
> > given. So e.g. bar #1 my buying conditions are met, but I don't 
buy 
> > yet, during bar# 2 the price remains under #1's High, I don't 
buy; 
> > during bar #3 the price rises above #1's High: I buy at that 
price. 
> > (Effectively I never buy on bar #1)
> > (Aka "extreme point rule")
> > 
> > So I have something like:
> > Buy = Cond1 AND Cond2 (etc);
> > 
> > 1. But then I don't really want to buy yet, I will wait till 
during 
> > one of the next 4 or 5 bars the price rises above the High of the 
> > signal's bar. So I change "Buy" into "Buysignal" or so and make a 
> > new "Buy". But how would I formulate this? It's probably 
something 
> > with BuyPrice and IFF I guess, but I can't figure out how.
> > 
> > Or would I have to rewrite the whole formula?
> > 
> > 2. I don't want to wait too long for a confirmation either, so if 
> > there's no confirmation within 5 bars, I will not buy, and don't 
> want 
> > a signal anymore.
> > 
> > Any help appreciated.
> > 
> > allm4m.