Choosing Trading Actions with Costs and Portfolio Context
Summary
The document considers how to choose buy, sell, or hold actions from historical stock data while accounting for transaction costs, bid-ask spread, and slippage. It cautions that the problem cannot be judged by the apparent size of its search space alone: a useful formulation needs a defined objective, cost model, data resolution, constraints, and market dynamics. Structured optimization methods can solve some formulations without exhaustive search, but the appropriate method depends on those choices.
The responses also warn against optimizing each asset’s trades in isolation. Portfolio construction must account for correlations and interactions among holdings, and the discussion points toward risk-factor allocation as a related approach. One response suggests smoothing prices and using slope changes to identify candidate turning points, with smoothing adjusted for costs. That idea is only a brief suggestion: the document provides no tested results or detailed procedure, and it does not establish that such signals are optimal or robust.
Key ideas
- Define the objective, transaction-cost model, constraints, and data resolution before selecting an optimization method.
- A large apparent search space does not by itself imply that an optimization problem is computationally intractable.
- Evaluate assets in the context of portfolio correlations rather than treating each stock as an independent decision.
- Smoothing prices and identifying slope changes is suggested as a candidate signal, with smoothing tied to trading costs.
- The discussion provides no empirical comparison or evidence that any proposed method is profitable.
Tags
Full text
# Determining optimal trading signals (buy/sell) from past data # Determining optimal trading signals (buy/sell) from past data 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? ## Answer by MichaelJ (score 2, accepted) https://quant.stackexchange.com/a/12631 The specific procedure depends on details of the problem such as - What is the objective function? Sharpe ratio? Terminal wealth? - What is the model of transaction costs? - What is the data resolution? (If it's very high the problem may become challenging computationally). There are many papers, e.g. this one, that solve various problems of this sort. These are most certainly not black-box optimization problems. There are specific, and well-motivated objective functions, constraints, and dynamics. You should understand that, in general, the size of the search space is not a good guide as to whether the problem can be solved efficiently or not. Brute force exhaustive search is almost never utilized for non-trivial optimization problems. It is often the case that a problem over an infinite set (e.g a linear program) is much easier than a problem over a finite set (e.g. an integer program). ## Answer by zuiqo (score 2) https://quant.stackexchange.com/a/11548 I think what you're trying to do is to construct a portfolio from inside out, i.e. picking stocks based on idiosyncratic factors. I have never heard anyone (within the industry) succeed with this, and, to my knowledge, the literature in this direction is pretty slim. The main reason is that in finance, the Markowitz approach is dominant to this day. Put simply, because a portfolio holds a variety of stocks, you always have to consider how they interact, that is, consider their correlation. As volatility is not additive (partly due to correlation), you should not invest in stocks by looking at them individually, but consider the entire portfolio. If a stock is negatively correlated with another, their movements will cancel out, so if your knowledge of the future is incomplete, it will enhance the portfolio as a whole. The closest thing to what you intend would probably be fundamental analysis, but the research does not show consistent outperformance afaik. Alternatively, look into smart beta asset allocation, which considers underlying risk factors for portfolio consruction. ## Answer by clearlyMakingFunOfQstAsked (score 2) https://quant.stackexchange.com/a/12619 you can smooth your data and then find the zeros of the slope of the smoothed data. You can adjust for the costs with the degree of smoothing.
Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.