Hi,

My requirement is a little different. I have two conditions for a Buy or a Sell 
to occur. When I put the two conditions together with an AND  the problem is 
that both have to occur simultaneously on the same day for the Buy signal to be 
generated. I would like the signal to be generated when and on the day the 2nd 
condition is met, if already the 1st signal has been met on an earlier day but 
is not occuring on this particular day. 

i.e., eg., 1st condition gave a Buy on 20th July, afterwards this condition is 
not met for a few days nor has it given a Sell. On say the 25th the 2nd 
condition also signals a Buy. With my existing coding this doesn't give a buy, 
and will wait till both occur simultaneously say on 27th. However, what I need 
is that the Buy signal should be shown on 25th, when the 2nd signal is a Buy 
and the 1st signal had given its last signal as Buy on an earlier day. 

Is it possible to do an AFL meeting this requirement?

--- In [email protected], "dwrowley_2000" <dwrow...@...> wrote:
>
> 
> If you want two bars of positive signal before you enter a trade, you can do 
> something like:
> 
> PrelimBuy = <condition>
> 
> Buy = PrelimBuy AND Ref(PrelimBuy,-1)
> 
> This will only initiate a BUY if PrelimBuy is true for two consecutive bars
> 
> D.
> 
> --- In [email protected], "prasantaroy36" <prasantaroy36@> wrote:
> >
> > 
> > 
> > --- In [email protected], "prasantaroy36" <prasantaroy36@> wrote:
> > >
> > > Dear friends
> > > 
> > > After fulfill buy & short  condition, trade will be done after 2nd bar 
> > > closing price from signal bar if valid still signal generated condition. 
> > > So, what will be the afl logic for backtesting purpose?
> > > Pl,guide.
> > > 
> > > Thanks
> > >
> > 
> > 
> > 
> > Pl, help
> >
>

Reply via email to