1 # Calculate Cumulative Returns 2 df = df[201:end,:] 3 df[:Cum_Rets] = cumprod(1+df[1:end, :Signal_Rets])-1 4 df[:BH_Cum_Rets] = cumprod(1+df[1:end, :Close_Rets])-1g] .* df[:Close_Rets]