Humans can flexibly pursue goal-oriented behavior in the face of changes in the environment. Cognitive control refers to this set of processes allowing such adjustments, and is thought to rely on neural oscillations in the theta band (4-8Hz). First, theta amplitude increases when control is needed, and second, shifts of peak frequency in the theta band have been suggested to reliably balance task representation and gating of task-relevant sensory and action information. However, it remains unknown how these two characteristics of the control signal interact and how optimal configuration for task performance is achieved. To tackle this question, we developed a computational model that relies on reinforcement learning principles to find optimal control settings for task performance. Our simulations show that these different oscillatory characteristics play distinct roles in the flexible adjustment to task demands. This work opens new avenues for research on the mechanisms allowing cognitive flexibility.