How would you challenge this algo?

Discussion in 'Automated Trading' started by Drawdown Addict, Aug 5, 2023.

  1. I've been trading this algo for a while, needless to say that it does not perform as well as it is on paper but still can scratch a good winning ratio, as opposed to the great score of 4.81 that is shown on the picture.

    Trades attached. (trades.csv)
    Input data attached. (MNQ.txt) JSON format.

    Result:

    upload_2023-8-5_7-49-48.png

    I tried with several time frames and periods, the results are more or less the same.
    I fail to believe that I hit the nail on the head and I am expecting it to break at some point. Do you have some data at hand that I could run the algo on?

    For the ones that want to replicate it, it is fairly simple. It is a trend following algo with a few simple rules:
    - Only one trade at a time. 5 contracts.
    - Enter on a clear trend, noted by at least four candles in the same direction.
    - Exit on the next candle close either if it increases o decreases 50 points.
     
    Last edited: Aug 5, 2023
    NASRI, SimpleMeLike and TrAndy2022 like this.
  2. PPC

    PPC

    Algo systems are almost always very dependent on the market condition, and the sequence of the R distribution as seen on your screenshot seems to confirm that it most likely is the issue you’re running into. There is no easy fix as far as I'm aware of. You can try some filters but ensure that you maintain robustness of the system.
     
  3. virtusa

    virtusa

    You are missing (one of) the most important numbers: mesuring the strenght of the trend.

    Depending on the strenght of the trend, you can have to:
    • enter after one or two candles in the same direction
    • exit after much more, or less than 50 points
    In a strong trend you can stay longer than 50 points, in a weak trend you maybe have to get out at 10 points.
    There should be a logical link between the candles and the strenght of the trend. But you have not. You probably tested how many candles where optimal with the data you had. Other data can give different results.
    Same remark for the 50 points take profit.

    You make the same error as people who use stochastics, bollinger bands or RSI to buy/sell in overbought/oversold areas. These areas can give fake signals depending on the strenght of the trend. In a strong trend the overbought/oversold areas give to early signals.
     
    Last edited: Aug 5, 2023
  4. TrAndy2022

    TrAndy2022

    Did you check Out-of-sample performance on prior insample backtested optimized data, so you know that your edge will last at least a certain in the future (beginning from the past) ? How many rolling walk forward analysis windows did you check for the performance to see if it is stable over time ? The stratey you presented looks superb with a Sharpe Ratio over 5 or 6 estimated. That is world class if that performance can be held in realtime trading. So far so (very) good.
     
    Last edited: Aug 5, 2023
    NASRI and Drawdown Addict like this.
  5. Ok, and the obvious question is how would you measure the strength of the trend?
     
  6. I need way more data for that analysis. But really good points, I will run a few more tests on all of that.
     
    TrAndy2022 likes this.
  7. virtusa

    virtusa

    Ok, and the obvious answer is: That's up to you to find out.
    Strenght of trend: That's what all the rest has to be built around.

    I just point out the missing parts of your algo.
    You always need a self adapting system, no matter what kind of approach you have. Markets are dynamic, not static. Your system should be dynamic too.
    Reoptimize parameters after every x trades is not dynamic. It is running behind reality while never being able to catch up.
     
    Last edited: Aug 5, 2023
    NASRI likes this.
  8. themickey

    themickey

    Measure the angle of it.
     
    virtusa and Drawdown Addict like this.
  9. TrAndy2022

    TrAndy2022

    They are the cheapest with good quality if you need more intraday or tick data. anfutures(.)com //https://www.anfutures.com/data_nq.htm
     
    Drawdown Addict likes this.
  10. I was thinking about that exactly, derivatives to find tangent slope. But it is always related to a couple of points I define. This should improve the way to exit. It is definitely a way to go.
     
    #10     Aug 5, 2023