Optimal Time-Constrained Trading Strategies for Autonomous Agents