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

[EquisMetaStock Group] Re: How do I stop an indicator repeating itself?



PureBytes Links

Trading Reference Links

Try something like this:

---8<---------------------------

{ Long entry-related timed exit }

{ ©Copyright 2004~2006 Jose Silva
  For personal use only.
  http://www.metastocktools.com }

{ User inputs }
pds:=Input("Ignore signals for n periods",1,2600,10);
plot:=Input("Signals:  [1]Clean,  [2]Original",1,2,1);

{ Sample binary signal }
bin:=C>Mov(C,21,E);

{ Entry-related latch }
latch:=If(PREV>0,If(BarsSince(PREV<=0)<pds,1,-1),bin);

{ Clean Entry signals }
entry:=latch=1 AND Alert(latch<1,2);

{ Plot signals in own window }
If(plot=1,entry,bin)

---8<---------------------------


jose '-)
http://www.metastocktools.com




--- In equismetastock@xxxxxxxxxxxxxxx, "notharold" <notharold@xxx> 
wrote:
>
> I have a number of indicators which egual 1 when the condition is
> met and O when it is not. Is there an easy way of coding so that if
> the indicator has been positive in the last n periods it will not
> show as positive again?  I've got myself into a complete muddle with
> nested if statements....






 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/equismetastock/

<*> To unsubscribe from this group, send an email to:
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/