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

Re: [Metastockusers] Counting Signals



PureBytes Links

Trading Reference Links

Hi draggiedriver

> I am playing with a HHV breakout system at the moment. As you might
> expect, Buy signals tend to come in clusters.
>
> I want to investigate whether the first Buy (ie last signal was
> Sell) might be better discarded.
>
> I must admit that my understanding of counting in MS is not the
> best. Can anyone help me here?


Here's a bar or event counter. It requires a signal to count and a reset signal when it's time to 
start over. Creating the reset may be your biggest challenge. This can count all bars when a signal 
is active, or just the leading edge - set the default to suit. I've set it up with some basic 
repetitive signals so it will plot on a daily or weekly chart without needing any changes.


The principle of this counter is quite simple. It counts ALL signals from the beginning of the 
chart, and subtracts from that the counter value as at the last reset signal. It's a roundabout way 
of doing it, but you get that with MetaStock. Hope this helps.

  {Bar or Event Counter}
  {2005 rlarsen@xxxxxxxxxxxxxx}
D:=Input("Event Counter, 0=Leading Edge, 1=Bars True",0,1,0);
A:=DayOfMonth()>=28; {count this signal}
B:=Month()=12;      {reset signal}
I:=Cum(A+B>-1)=1; {count / reset signals valid}
A:=If(D,A,A*Alert(A=0,2));
X:=Cum(A); {bar count}
  {count signal leading edge or bars true}
Z:=X-ValueWhen(1,I+B,X); Z;


Kind regards

Roy Larsen
www.metastocktips.co.nz
Free formulas and MS links





------------------------ Yahoo! Groups Sponsor --------------------~--> 
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EpW3eD/3MnJAA/cosFAA/zMEolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

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

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

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