Sharing experience – choosing optimal conditions/filers

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #184085 quote
    Khaled
    Participant
    Veteran

    Hello everyone!

    May be I’m saying the obvious, just sharing my experience…

    Sometimes, we keep adding conditions until we reach a point where we don’t exactly know which ones generate profit and which makes you miss good opportunities. Say, for the sake of the argument, you have 10 conditions (Close breakout, MA crossing, RSI, Stoch, Volume, ADX, ATR, etc.), but you want to know which ones generate profits and which ones make you miss good trades.

    The way I found to approach this issue is to add to each of my condition (x factor) and simulate with the value of each factor varying between 0 and 1. So 10 conditions times 2 options, you run 20 tests and will find which conditions are most optimal and can therefore remove the rest. Screenshot below shows that the optimal case is to keep all the conditions.

    Do you see another way to do it more efficiently?

    MyRSI  = RSI[14](close)
    CondLongRSI = MyRSI>30 and MyRSI>MyRSI[1]
    
    if not longonmarket and CondLongRSI*f1 and CondVol*f2 and CondADX*f3 etc,
    Capture-décran-2021-12-29-à-11.39.07.png Capture-décran-2021-12-29-à-11.39.07.png Capture-décran-2021-12-29-à-11.56.43.png Capture-décran-2021-12-29-à-11.56.43.png
    #184090 quote
    GraHal
    Participant
    Master

    How about … assign a Flag (Flag1, Flag2 … etc) to each condition and then optimise the Flag numbers to see which Flag give the best performance. Then remove that Flag number and optimise the remaining Flag numbers (and therefore optimise conditions) and so on.

    Or is my suggestion what you are saying in your post above? 🙂

    Khaled thanked this post
    #184092 quote
    Khaled
    Participant
    Veteran

    Indeed the (x factor) I was referring to is a flag (0,1). If a condition is unnecessary or suboptimal, the backtest will flag it “0”. I think we are saying the same thing.

    #184097 quote
    PeterSt
    Participant
    Master
    So 10 conditions times 2 options, you run 20 tests and will find which conditions are most optimal and can therefore remove the rest.
    Hi Khaled – I’m afraid that 10 conditions generate 2^10 (=1024) number of tests, not 10.  Please notice that
    Sometimes, we keep adding conditions until we reach a point where we don’t exactly know which ones generate profit
    to me implies “stacked”. Or maybe I should say “that this is how I would add and add conditions”. Of course not all conditions combine, but generally mine do (as an additional filter). So it is my estimate that it is a little bit more complicated because at least “several” of your 10 will combine. The remainder will not (and implies losses – so what) and does contribute to significantly longer backtest times, obviously. On another note : such an application will be the best curve fitting application ever. At last that is what I think. 🙂 Otherwise it is just a good thing to incorporate all the possibilities into the one system, and switch things on and off by means of such switches. Of course it makes the program larger, but later you can always revisit a condition and see how it operates together with your newly found filter. Anyway

    if not longonmarket and CondLongRSI*f1 and CondVol*f2 and CondADX*f3

    that is a nice and transparent way to do it. One thing : Later in practice you would need those variables to have a fixed value like f1 = 1 f2 = 0 f3 = 1 However, that won’t read well further down in the code. Thus my suggestion would be fLongRSI = 1 fVol = 0 fADX = 1 Downside of this : your BackTest Results form will be way more wide.
    Khaled thanked this post
    #184098 quote
    Khaled
    Participant
    Veteran
    Peter, thanks for your feedback. My bad on the number of possibilities. I agree… Just a way to quickly eliminate conditions which do not add value.
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Sharing experience – choosing optimal conditions/filers


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Khaled @khaled Participant
Summary

This topic contains 4 replies,
has 3 voices, and was last updated by Khaled
4 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 12/29/2021
Status: Active
Attachments: 2 files
Logo Logo
Loading...