Let's say you are building a simple model (like the classroom examples) of trying to predict, given past information, if the stock goes up or down in the future. One could, like in classroom examples, turn this into a classification problem, and encode 1 if stock goes up, 0 if unchanged, and -1 if stock goes down.

When modeling such a model, in practice, would you:

  1. Look at the ending prices of different fixed intervals, for example, 1 min, 1day, 2day, etc.. So if the stock price is higher exactly 1 min from now, you would encode this as a 1.

  2. Or model so that at any point in time within 1min, 1day, 2day, the stock goes up in price. So let's say your time frame is 1min, and the stock goes up at the 30 second mark, but then goes back down and ends up negative, you would still encode it as a 1.

In the class room, we tend to do the former. But I would imagine in practice that this would lead to some datamining of the time period for the response - as what time period would you choose? The latter makes more practical sense as you just care if there's an opportunity to trade at a higher price. But, effectively, the time period of the response is different for each example - not sure how that would affect any of the assumptions and results of statistical/ML models.

Which would you say is more effective in practice?



In time series prediction for trading there are two parts:

-prediction model
-trading strategy based on it. 

As for construction of prediction model, there are also two parts:

- feature selection (which can be very time-consuming)
- actual prediction.

For feature selection the model should be simple and thus just predicting direction is more desirable.You can add threshold to direction i.e. y=0 unless next price> bid-ask spread plus some margin (at the end of some period).

Once you selected the relevant features, you can ask your model to predict more complex event, such as hitting upper/lower barrier (emulating trading strategy with stop loss/ take profit) as described in De Prado's Book, in Triple-Barrier Method and in details in this post https://towardsdatascience.com/financial-machine-learning-part-1-labels-7eeed050f32e

At the end when you have your backtested/cross-validated predicting model, you can adopt any trading strategy. Usually only small subset of tradings strategies based on your prediction model will be profitable enough.You can examine in detail these profitable trading strategies and then amend your labelling on step 1 to be more complex (i.e. include elements of your trading strategy), and repeat the whole process iteratively.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.