I'm trying to build a cumulative sum syntax based on the following formula:
X(t) = max(0, X(t-1) + W(t))
X0 = 0 t= 1,2,3,... W(t) = given by another variable (not relevant here)
The aim is to plot it into a graph. Can anyone help my convert this formula into a syntax function?