Let's say we have a stock which our only actions are buy, sell and hold (with or without shorting).
If we have sufficient past data of the stock, how can you determine the optimal trading action every time-stamp in the past in an efficient or even optimal way? Transaction costs, bid-ask spread and slippage would definitely have to be included.
I can think of this as a black-box optimization problem, but the search space is large, so the search would be inefficient.
I tried to search the literature for pointers, but nothing came out of it. Has anyone researched good ways to do this?