HI. Need help returning the value “D”.
I am trying to compare todays close with yesterdays for a specific hour, in this case 21000. Then I want to accumulate the difference over time, “D”, with a start value of 100, “ONCE D=100”. But the code will only return the value “100” for “D” and not adding the movement per day.
ONCE D=100
IF TIME=210000 THEN
C=CLOSE
A=(C-C[1])/C[1]//percent movement per day
B=D*A//Value movment per day
D=D+B//Accumulated value over time
ENDIF
RETURN A*100 AS “PROCENT”, B AS “VALUE”, D AS “ACCUMULATE”