I just came accross a sample in the Knowledge Base that does what you're looking for. I'll leave it to you to determine if they give the same results or not.
http://www.amibroker.com/kb/2006/03/06/preventing-exit-during-first-n- bars/#more-6 --- In [email protected], "Louis Préfontaine" <[EMAIL PROTECTED]> wrote: > > Thanks Mike! This look very easy but it seems like it will work! > > Louis > Louis > > 2008/4/9, Mike <[EMAIL PROTECTED]>: > > > > Assuming that your Buy logic is a crossing type signal as provided in > > your example (i.e. Cross(MA...)). You could probably just introduce a > > no signal zone using BarsSince. > > > > Buy = Cross(...); > > DeadZone = BarsSince(Buy) <= 10; > > Signal = ...; > > Sell = Signal AND NOT DeadZone; > > > > Note that if a first Buy is fired, then crosses down and rises back > > up to trigger a second Buy before the 10 days, the first Buy will > > never be acted on and the dead zone will start over with the second > > Buy. > > > > Mike > > > > --- In [email protected] <amibroker% 40yahoogroups.com>, "Louis > > Préfontaine" > > <rockprog80@> wrote: > > > > > > Buy = Cross (xxxx) ; > > > Buy = ExRemSpan (Buy,10); > > > Sell = Ref (Buy,-10); > > > > > > > > > > > > 2008/4/8, Louis Préfontaine <rockprog80@>: > > > > > > > > Hi, > > > > > > > > Right now I have > > > > > > > > Buy = Cross (xxxx) ; > > > > Buy = ExRemSpan (Buy,10); > > > > Sell = Ref (Signal,-10); > > > > > > > > The systems exits after 10 days. I'd like to keep it open for at > > least 10 > > > > days and then to close only when signal is met. > > > > > > > > I tried the Signal as you said but it didn't work... > > Unfortunately... > > > > > > > > Thanks for your help, > > > > > > > > Louis > > > > > > > > 2008/4/8, Howard B <howardbandy@>: > > > > > > > > > > Hi Louis -- > > > > > > > > > > Does this do what you are thinking? > > > > > > > > > > Signal = Cross(xxxxxx); > > > > > Buy = Ref(Signal,-5); > > > > > > > > > > Thanks, > > > > > Howard > > > > > > > > > > > > > > > On Mon, Apr 7, 2008 at 5:35 PM, Louis Préfontaine > > <rockprog80@> > > > > > wrote: > > > > > > > > > > > Hi, > > > > > > > > > > > > I am trying to set a "no-signal" zone that would be followed > > by a > > > > > > signal that I would set by myself. > > > > > > > > > > > > As an example: > > > > > > > > > > > > Buy = Cross (Ma... > > > > > > Buy= exremspan (Buy,5); > > > > > > Sell=... > > > > > > > > > > > > I'd like the system to do NOTHING for 5 days, but then to > > react on > > > > > > whatever the signal I want to choose. I know this sound > > simple, but I just > > > > > > can't do it. > > > > > > > > > > > > Thanks, > > > > > > > > > > > > Louis > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
