Research on moral cleansing and moral self-licensing has introduced dynamic considerations in the theory of moral behaviour. Past bad actions trigger negative feelings that make people more likely to engage in future moral behaviour to offset them. Symmetrically, past good deeds favour a positive self-perception that creates licensing effects, leading people to engage in behaviour that is less likely to be moral. In short, a deviation from a ‘normal state of being’ is balanced with a subsequent action that compensates the prior behaviour. We model the decision of an individual trying to reach the optimal level of moral self-worth over time and show that under certain conditions the optimal sequence of actions follows a regular pattern which combines good and bad actions. To explore this phenomenon we conduct an economic experiment where subjects play a sequence of giving decisions (dictator games). We find that donations in the previous period affect present decisions and the sign is negative: participants' behaviour in every round is negatively correlated to what they did in the past. Hence donations over time seem to be the result of a regular pattern of self-regulation: moral licensing (being selfish after altruistic) and cleansing (altruistic after selfish).