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

Re: holdtill()



PureBytes Links

Trading Reference Links

Hi Marek,
One problem with flip is the following.
Suppose that the value to be hold is controlled
under cond1, the flip is 1 under cond2 and 0 under
cond3. If between 2 and 3 the value changes 3 times
because you had 3 "true" cond1, which value will you hold?
On the other side, flip will give repetitive signals, Don may
ask to hold a value only once.
Think about, it is not that simple.
Dimitris Tsokakis 
--- In amibroker@xxxx, "Marek Chlopek" <mchlopek@xxxx> wrote:
> > From: farriners@xxxx [mailto:farriners@x...]
> > Sent: Sunday, December 02, 2001 6:18 AM
> > To: amibroker@xxxx
> > Subject: [amibroker] holdtill()
> >
> >
> > Hi,
> > The function hold(expression,periods) obviously needs to know the
> > number of periods.
> > I want to hold a value until a condition occurs.
> > I have suggested to TJ that a holdtill(expression,condition) 
would be
> > useful.
> > Can anyone suggest a way to code this? (in case TJ doesnt like the
> > idea!)
> 
> Don,
> Try function Flip()
> 
> .....
> exp1 = expression();
> cond1 = condition();
> exp1 = Flip(exp1, cond1);
> 
> 
> Regards
> Marek