Optimizing a position typically requires two things: An assumption about how prices will behave in the future An objective function to maximize/minimize For certain cases in finance, we have closed-form solutions for optimal positions. For instance: Markowitz portfolio optimization states that if pr...