Out-of-sample trading strategy with neural networks

Discussion in 'Strategy Building' started by ssp729, Nov 18, 2020.

  1. userque

    userque

    With ML, it can be done, but you have to really know what you're doing if you want to solve trading problems to a profitable degree. I'm not talking about Neuroshell as I don't know enough about it; I'm talking about actual, full featured ML software.

    Having the correct software/platform is one thing; knowing how to properly use it is quite another.

    See here for many examples:

    https://www.kaggle.com/search?q=stock+market
     
    #21     Nov 19, 2020
  2. First, most of the machine learning models for markets are garbage. I even saw one example with bidirectional LSTMs, which as a previous poster mentioned, has possibly millions of trainable parameters.

    Second, your target variable is not numeric; it's a simple buy-or-sell signal with probabilities. So, let's say you take the whole universe of technical analysis variables and train your model with cross-validation. Again, your model will fare poorly because of the changing nature of the market (you've basically trained the model for one snapshot in time).

    Finally, you're better off predicting conditions such as "wide range" or "narrow range". This way, you can apply a trend or counter-trend system based on a high probability within a calibrated model, filtering out the low-signal results.

    You can take a look at some of my work here:

    https://github.com/ScottfreeLLC/AlphaPy
     
    #22     Nov 21, 2020
  3. guowei58

    guowei58

    ML is a tool and like all tools, used in the right way, it will give you good results. it's no different than using technical analysis, fundamental analysis, price action or your own intuition...

    For ML particularly, I would try to limit the number of variables, degrees of freedom or increase the sample size. typically, you need 2K of trades in order to have statistical significance. as you increase the number of variables, you should increase the sample size too. the bigger the sample size, the less overfit the model is. Linear regression works great because you have 1 degree of freedom, and are guarateed to find that small advantage without overfitting the data. Those small advantages really add up...ML should be able to do better given enough data.
     
    #23     Nov 22, 2020
    rb7 likes this.
  4. userque

    userque

    Good post.

    But the problem isn't necessarily the number of variables. The real problem is having variables that don't correlate, and not doing out of sample validation (or turning OOS data, into in sample by repeated testing).
     
    #24     Nov 23, 2020
  5. ssp729

    ssp729

    thanks for all the answers. I decided, after pros and cons, giving up trying to predict the close price, percent change, open, high or anything related to financial time series.
     
    #25     Nov 24, 2020