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

Re: Remebering a value



PureBytes Links

Trading Reference Links

I have a similar problem - I want to use the entry day's low (or 
high, if Short) as my Max loss stop. I do this in the code:

MaxLossBuyStop = ValueWhen(Buy, Low); 

The problem is (even using ExRem(Buy, Sell) ), this value gets reset 
every time a new Buy signal occurs. I know ExRem is working because I 
can do "Show all Raw signals", and the extra signals are removed - 
but ValueWhen apparently does not respect this, as my stop value gets 
changed every time a new buy signal occurs, even if I'm in a position 
at the time.

How do I avoid this?

Thanks,
Chris

--- In amibroker@xxxx, "IVA GmbH" <funnybiz@xxxx> wrote:
> THERE we go!
> 
> So, I must must be dumber than originally thought, tee hee!
> 
> Thaaaaaaaaanx!
> 
> Markus
> ----- Original Message -----
> From: "Tomasz Janeczko" <amibroker@xxxx>
> To: <amibroker@xxxx>
> Sent: Wednesday, July 24, 2002 9:16 PM
> Subject: Re: [amibroker] Re: Remebering a value
> 
> 
> > Hello,
> >
> > 2. In that case use:
> >
> > LastValue( ValueWhen( condition, array, Nth ) );
> >
> > Nth parameter specifies if you look for 1st, 2nd, 3rd most recent
> occurrence.
> >
> > Best regards,
> > Tomasz Janeczko
> > amibroker.com
> > ----- Original Message -----
> > From: "IVA GmbH" <funnybiz@xxxx>
> > To: <amibroker@xxxx>
> > Sent: Wednesday, July 24, 2002 8:56 PM
> > Subject: Re: [amibroker] Re: Remebering a value
> >
> >
> > > TJ,
> > >
> > > thanks for the feedback!
> > >
> > > As to 1./, it is clear to me now.
> > >
> > > As to 2./ : NO, I meant the first time backwards from the LAST 
bar on
> the
> > > chart. Is there a way to determine the occurence as well, i.e. 
checking
> fir
> > > the second, third etc. time it occured from the LAST bar loaded 
on the
> > > chart????? Lowestsinceand Lowestsincebars contain such an 
occurence and
> > > thats very nice...
> > >
> > > Markus
> > >
> > >
> > >
> > > Markus
> > > ----- Original Message -----
> > > From: "Tomasz Janeczko" <amibroker@xxxx>
> > > To: <amibroker@xxxx>
> > > Sent: Wednesday, July 24, 2002 4:55 PM
> > > Subject: Re: [amibroker] Re: Remebering a value
> > >
> > >
> > > > Hello,
> > > >
> > > > 1. BarsSince looks only into the past from TODAY till the bar 
until
> > > condition was true.
> > > >
> > > > 2. Do you mean first time from the very first bar loaded? If 
so you
> can
> > > use:
> > > >
> > > > firstoccurrence = Cum( Flip( Condition, 0 ) ) == 1;
> > > >
> > > > to find out the very first bar when Condition was true.
> > > >
> > > > Best regards,
> > > > Tomasz Janeczko
> > > > amibroker.com
> > > > ----- Original Message -----
> > > > From: "IVA GmbH" <funnybiz@xxxx>
> > > > To: <amibroker@xxxx>
> > > > Sent: Wednesday, July 24, 2002 4:12 PM
> > > > Subject: Re: [amibroker] Re: Remebering a value
> > > >
> > > >
> > > > > Thanks!
> > > > >
> > > > > Please allow two questions:
> > > > >
> > > > > 1./ Does barssince look back into the past or forward into 
the
> future
> > > from
> > > > > the point where the condition L1 is/was true?
> > > > >
> > > > > 2./ Condition L3 might be true for severeal instances. Do 
you have a
> > > clue on
> > > > > how to detect the FIRST time it is true? I havenīt yet 
found an AFL
> > > command
> > > > > that checks the truth for the occurence of my desire 
(frist, second
> > > etc.).
> > > > >
> > > > > Thanks again!!
> > > > >
> > > > > Markus
> > > > > ----- Original Message -----
> > > > > From: "nenapacwanfr" <nenapacwanfr@xxxx>
> > > > > To: <amibroker@xxxx>
> > > > > Sent: Monday, July 22, 2002 4:23 AM
> > > > > Subject: [amibroker] Re: Remebering a value
> > > > >
> > > > >
> > > > > Perhaps it can help you
> > > > >
> > > > > L1= Low < Ref(LLV(Low,5),-1);
> > > > > L2= BarsSince(L1);
> > > > > L3= High > Ref(HHV(High,5),-1) AND L2>0;
> > > > > Plot(L2,"",7,1);
> > > > > Plot(L3,"",8,1);
> > > > >
> > > > >
> > > > > > I try to come up with a code that tells AB to look for
> high>Ref(hhv
> > > > > (high,-5,-1) to be true when low<Ref(llv(low,5),-1) is 
true, i.e. a
> > > > > specific bar from which the hhv and/or llv functions should 
start.
> > > > > >
> > > > > > Has ansone an idea how to do this???????????
> > > > > >
> > > > > > Any comment/suggestion is welcome. Iīm going crazy on 
this.
> > > > > >
> > > > > > Markus
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > Your use of Yahoo! Groups is subject to
> > > http://docs.yahoo.com/info/terms/
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > Your use of Yahoo! Groups is subject to
> > > http://docs.yahoo.com/info/terms/
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> > >
> > > Your use of Yahoo! Groups is subject to 
http://docs.yahoo.com/info/terms
> /
> > >
> > >
> > >
> >
> >
> >
> >
> >
> > Your use of Yahoo! Groups is subject to 
http://docs.yahoo.com/info/terms/
> >
> >
> >