A Penalized Shared-parameter Algorithm for Estimating Optimal Dynamic Treatment Regimens