Technique help to reduce over-fitting

Viewing 15 posts - 31 through 45 (of 64 total)
  • Author
    Posts
  • #143234 quote
    zilliq
    Participant
    Master

    Always Keep It Simple (In code and strategy). 3 Variables only, 100 000 units.

    Strategy without overfitting (or as little as possible) based on Stochastics I develop today, but no matter for the strategy on backtest. Need to test on OOS now

    Have a nice evening

    [attachment file=”143235″]

    Paul and MAKSIDE thanked this post
    2020-09-02_19h56_23.jpg 2020-09-02_19h56_23.jpg
    #143238 quote
    Nicolas
    Keymaster
    Master

    No loosers?

    #143239 quote
    Dow Jones
    Participant
    Veteran

    Your new strategy looks nice, @zilliq, thanks for the tips too.

    Btw, recently I picked up a topic thanks to @vonasi, I think it is helpful on reducing the optimization time as well (which I believe everyone is so eager).

    Control of yearly/monthly/weekly profit/loss => https://www.prorealcode.com/topic/annual-percentage-returns/#post-93664

    The article is originally for yearly, but you can transform it to monthly/weekly (below I share example for monthly). The better is even set a range of highest profit and lowest loss allowed.

    Since we added a quit once the bad month happened, thus the back test is faster, it will not continue to test for the rest of the months.

    You can even add a condition check to not have consecutive month/weeks (even days) of loss, e.g. do a summation[3](monthlyreturn) <= 0 for no 3 months consecutive loss.

    capital = 5000
    once lastcapital = capital
    runningperc = ((strategyprofit - laststrategyprofit) / lastcapital) * 100
    
    if month <> month[1] then
    monthlyreturn = runningperc[1]
    laststrategyprofit = strategyprofit
    lastcapital = capital + strategyprofit
    total = total + monthlyreturn
    count = count + 1
    //monthlyaverage = total/count
    endif
    
    if monthlyreturn < -0.5 then
    QUIT
    endif

    Since the optimization timing is faster (thanks to skip the bad parameters), you can have a bigger range of optimization.

    #143240 quote
    Dow Jones
    Participant
    Veteran

    I guess you are teasing us and you are not going to share your excellent looking Strategy??

    @GraHal, you can subscribe when he put in market place, haha 🙂 But I’m sure you also have such strategy, right? Perhaps same for many people here as well…

    #143242 quote
    zilliq
    Participant
    Master

    No loosers?

    Of course there is losers;- 87 % winners
    100 % winners on 100 000 units = Overfitting for me

     

    @dow jones LOL not even.

    I consider to sell an algo is a scam because it need always some work and retesting

    #143243 quote
    Paul
    Participant
    Master

    Zilliq, pure a simple risk/reward strategy with a certain ratio or other exit methods included?

    #143253 quote
    zilliq
    Participant
    Master

    Classical exit based on ATR @Paul

    Paul thanked this post
    #143260 quote
    Nicolas
    Keymaster
    Master

    Of course there is losers;- 87 % winners

    Good! Any chance to share the same screenshot with position size window below the equity curve?

    #143265 quote
    zilliq
    Participant
    Master

    Of course Nicolas, I just need to do another backtest. I will tomorrow

    #143268 quote
    zilliq
    Participant
    Master

    First OOS day for this Algos (Mean nothing as you now, but good start).

    Always a 1000 USD/day strategy (I don’t need more 🙂 )

     

    2020-09-03_10h18_11.png 2020-09-03_10h18_11.png
    #143365 quote
    zilliq
    Participant
    Master

    To continue to minimize the overfitting, today I begin an OOS demo test with a strategy on SAR to have only 2 variables

    58,99 % winners on the backtest but on 556 trades ! 100 000 units EUR/USD 1 mn Sharpe Ratio 1.1.

    We will see if it was a good idea 🙂

    Have a nice day

    Zilliq

    2020-09-04_12h01_48.jpg 2020-09-04_12h01_48.jpg
    #143367 quote
    Nicolas
    Keymaster
    Master

    @zilliq you should open a fresh new topic for your OOS forward test about this specific strategy, we are a bit off-topic now here, if you don’t mind.

    Francesco and Paul thanked this post
    #143374 quote
    Dow Jones
    Participant
    Veteran

    Control of yearly/monthly/weekly profit/loss

    An update to this one, below is an example to control on the consecutive monthly and weekly loss.

    You can probably extend it to maximum win for monthly/weekly too (I didn’t do it as it is already difficult to achieve no monthly and weekly loss over long period).

    I kind of think that a stable strategy should have stable income, so no huge spike or huge drawdown on certain period that resulted good total gain only.

    Adding this means the back test will stop for the combination if you will anyway don’t like it, e.g. if you won’t accept strategy that loss 2 consecutive months, then no point to continue the back test for whole period.

    So making the back test a bit faster. Hope you guys like it and suggestion welcome.

    //1. Check monthly not lower than expected profit and no consecutive month loss
    capital = 5000
    monthlymingain = -10
    maxconsecutivemonthlyloss = 1
    maxconsecutiveweeklyloss = 2
    once lastmonthlycapital = capital
    once lastweeklycapital = capital
    once consecutiveweeklyloss = 0
    once consecutivemonthlyloss = 0
    runningmonthlyperc = ((strategyprofit - lastmonthstrategyprofit) / lastmonthlycapital) * 100
    runningweeklyperc = ((strategyprofit - lastweekstrategyprofit) / lastweeklycapital) * 100
    
    //Ensure none of the month less than expected gain
    if month <> month[1] then
    monthlyreturn = runningmonthlyperc[1]
    lastmonthstrategyprofit = strategyprofit
    lastmonthlycapital = capital + strategyprofit
    if monthlyreturn < 0 then
    consecutivemonthlyloss = consecutivemonthlyloss + 1
    else
    consecutivemonthlyloss = 0
    endif
    endif
    if monthlyreturn < monthlymingain or consecutivemonthlyloss > maxconsecutivemonthlyloss then
    QUIT
    endif
    
    //2. Check consecutive week of loss is acceptable
    if opendayofweek < opendayofweek[1] then
    weeklyreturn = runningweeklyperc[1]
    lastweekstrategyprofit = strategyprofit
    lastweeklycapital = capital + strategyprofit
    if weeklyreturn < 0 then
    consecutiveweeklyloss = consecutiveweeklyloss + 1
    else
    consecutiveweeklyloss = 0
    endif
    endif
    if consecutiveweeklyloss > maxconsecutiveweeklyloss then
    QUIT
    endif
    Nicolas thanked this post
    #143380 quote
    Nicolas
    Keymaster
    Master

    Very good idea and thank you for that great snippet DowJones. But, while it should improve backtest time, you will also introduce a form of over-fitting by avoiding bad months, yeah i know nothing’s perfect 😉

    Dow Jones thanked this post
    #143386 quote
    Vonasi
    Moderator
    Master

    you will also introduce a form of over-fitting by avoiding bad months, yeah i know nothing’s perfect 😉

    Nicolas is right (as always!) Also remember that a strategy cares nothing about things like when the name/number of the current month changes.

    You could have a bad second half of a month and a bad first half of the next month and that back test is included in the results because both months are average results whereas if they same results had just happened a couple of weeks earlier and occurred all in the same month then that test would be excluded. Surely it is better just to have a rolling period or rolling quantity of trades and if the results are below what you would be happy to trade then quit the back test to save optimising time?

    Dow Jones thanked this post
Viewing 15 posts - 31 through 45 (of 64 total)
  • You must be logged in to reply to this topic.

Technique help to reduce over-fitting


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Dow Jones @yahootew3000 Participant
Summary

This topic contains 63 replies,
has 12 voices, and was last updated by Paul
5 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 08/27/2020
Status: Active
Attachments: 13 files
Logo Logo
Loading...