PureBytes Links
Trading Reference Links
|
Hi,
Simply re-assign the value to the buyprice variable
AFTER using exrem.
... your formula here buyprice gets assigned once ...
buy = exrem(buy, sell);
sell = exrem(sell, buy);
// now buy value is evaluated once again to
// change only when filtered buy occurs
buyprice = valuewhen( buy, buyprice, 1);
Best regards,
Tomasz Janeczko
> > >
> > > minGrowth = (close > buyprice * 1.08);
> > > stopLoss = (close < buyprice * 0.97);
> > >
> > > sell = minGrowth or stopLoss ;
> > >
--- In amibroker@xxxx, "Ralf Wenske" <ralf@xxxx> wrote:
> Hi Tomasz,
>
> thanks for your quick response.
> I suspected that it had to do with the filtering.
> The question I have is how do I get the buyprice after
> filtering: I understand that the filtering requires the sell.
> The sell requires the buyprice. The buyprice - as you
> point out - requires the filtered buy.
> And AFL requires predefined variables.
>
> Is there a solution?
>
> Cheers - Ralf
>
> ----- Original Message -----
> From: Tomasz Janeczko <tj@xxxx>
> To: <amibroker@xxxx>
> Sent: Friday, May 18, 2001 5:15 AM
> Subject: Re: [amibroker] AFL Mystery - 4th
>
>
> > Hi Ralf,
> >
> > The problem is that you FIRST get use not filtered buy
> > for calculating of buy price and AFTER that you
> > remove extra signals using ExRem().
> > This is the reason why your buyprice changes
> > when FILTERED buy does not happen.
> >
> > > buy = isCci AND isBullish AND isUp ;
> > > buyprice = valuewhen( buy, ref(open, 1), 1);
> > >
> > > minGrowth = (close > buyprice * 1.08);
> > > stopLoss = (close < buyprice * 0.97);
> > >
> > > sell = minGrowth or stopLoss ;
> > >
> > > buy = exrem(buy, sell);
> > > sell = exrem(sell, buy);
|