One major drawback of the eddy viscosity subgrid-scale stress models used in large-eddy simulations is their inability to represent correctly with a single universal constant different turbulent fields in rotating or sheared flows, near solid walls, or in transitional regimes. In the present work a new eddy viscosity model is presented which alleviates many of these drawbacks. The model coefficient is computed dynamically as the calculation progresses rather than input a priori. The model is based on an algebraic identity between the subgrid-scale stresses at two different filtered levels and the resolved turbulent stresses. The subgrid-scale stresses obtained using the proposed model vanish in laminar flow and at a solid boundary, and have the correct asymptotic behavior in the near-wall region of a turbulent boundary layer. The results of large-eddy simulations of transitional and turbulent channel flow that use the proposed model are in good agreement with the direct simulation data.