Metastock Formula

#1
Hello friends, I need one formule for metastock that to one predefined number of trading days count the number of days that the close is positive (P) and count the number of the days that the close is negative (N). After this subtract the P -N, this is the formula F = P - N

Thanks in advance
 

oxusmorouz

Well-Known Member
#2
Hello friends, I need one formule for metastock that to one predefined number of trading days count the number of days that the close is positive (P) and count the number of the days that the close is negative (N). After this subtract the P -N, this is the formula F = P - N

Thanks in advance
Pds:= Input("Look Back Period",1,10000,20);
a:= C > Ref(C,-1);
b:= If(a,1,-1);
Sum(b,Pds);

The user manual and formula premier offer good solutions to help code our formulas. A read of both is suggested.
 
Last edited:

Similar threads