1 # Calculate Close to Close Returns 2 Close = df[:Close] 3 x = convert(Array, Close) 4 out = zeros(x) 5 for i in 2:size(Close,1) 6 out[i] = Close[i]/Close[i-2+1] - 1.0 7 end 8 df[:Close_Rets] = out 9 # Calculate signal returns 10 df[:Signal_Rets] = df[:Signal_Long] .* df[:Close_Rets]