how can one count up the value of a variable, but only one time like
if(Rising(SMA(BarsArray[2],20))) varrising++;
if(Rising(SMA(BarsArray[3],20))) varrising++;
so that in total the value of the varrising would be 2 in this case (and not counting up with every new bar)
if(Falling(SMA(BarsArray[2],20))) varrising--;
if(Falling(SMA(BarsArray[3],20))) varrising--;
so that I would have varrising a value of 1 if one of both dataseries is falling.
OR/AND
another idea to resolve this is to give a fixed value like
if(Rising(SMA(BarsArray[2],20))) var2=1;
if(Rising(SMA(BarsArray[3],20))) var3=1;
but in this case I dont know how to add up with every bar like
valuevar = var2 + var3 + .....
Or could I do this aproach simply with int valuevar = var2 + var3 in onbarupdate?
So, because of being not a programmer I´m missing a brick with both ideas.
Thank you
Tony
Comment