PureBytes Links
Trading Reference Links
|
Try this:
Vars: Counter(0);
If close > average(50) then begin
If average(5) > average(10) then Counter = Counter + 1;
If average(5) > average(10) and average(10) > average(50) then
Counter = Counter + 1; End; If close < average(50) then begin
If average(5) < average(10) then Counter = Counter - 1;
If average(5) < average(10) and average(10) < average(50) then
Counter = Counter - 1; End;
Plot1(Counter);
/Stefan Johansson
-----Ursprungligt meddelande-----
Från: Alex.L [mailto:lexxa01@xxxxxxxx]
Skickat: den 21 februari 2005 11:53
Till: omega-list@xxxxxxxxxx
Ämne: need help with counting conditions
hello,
maybe any kind soul can help me.
i want to plot an indicator line based on a summation
of conditions.
if close > average(50) then all the plus conditions
sould be counted and if the trend ( c < average(50))
is down all the minuses should be counted.
so if trend is up and average(5) > average (10) then
+1 else 0
and if trend is up and average(5) > average(10) and
average (10) > average (50) then +1 else 0
so if all lines are up, the indicator would count 2
but if the trend is up and the rest not, it would
count 0.
how can i code an indicator which would count the
different conditions?
thanks for helping
alexa
___________________________________________________________
|