I would like to modify SUM so i can add a division.
Value[0] = Input[0] + (CurrentBar > 0 ? Value[1] : 0) - (CurrentBar >= Period ? Input[Period] : 0);
I want to divide by the number i want, like for exemple 4 or 6. so i tried:
Value[0] = Input[0] + (CurrentBar > 0 ? Value[1] : 0) - (CurrentBar >= Period ? Input[Period] : 0)/4;
Value[0] = Input[0] + (CurrentBar > 0 ? Value[1] : 0)/4 - (CurrentBar >= Period ? Input[Period] : 0)/4;
But it still does not give the right result. Anyone know why and how to write this right?
ty
Comment