Motivated by financial applications, we study convex analysis for modules over the ordered ring L0 of random variables. We establish a module analogue of locally convex vector spaces, namely locally L0-convex modules. In this context, we prove hyperplane separation theorems. We investigate continuity, subdifferentiability and dual representations of Fenchel–Moreau type for L0-convex functions from L0-modules into L0. Several examples and applications are given.