Optimisation Fails?

Forums ProRealTime English forum ProOrder support Optimisation Fails?

  • This topic has 19 replies, 6 voices, and was last updated 4 years ago by avatarBard.
Viewing 15 posts - 1 through 15 (of 20 total)
  • #95102

    Can anyone think of why this System won’t optimise the c2 entry condition?

    Dow Daily / 26th Aug 2010 – 12th Oct 2017 / 3.8 spread

    I actually am not sure how to code it so it takes a long trade after one day of no Bear condition (return to neutral, no Bulls, no Bears) having been preceded by eg, 5, days of a Bear condition? (Other than laboriously programming using, if indicator2[5] = -1, and indicator2[4]= -1, and indicator2[3]= -1, and indicator2[2]= -1, and  indicator2[1]= -1 are ALL Bears) AND this is then followed by an end of Bear condition (indicator2=0) (for one day) before the Long trade is then initiated?

    I was attempting to optimise the number of days prior that a Bear condition needs to be in place (from 1 to 300 days), before a long trade is initiated but that doesn’t mean it’s continuously been in Bear territory for ALL those days which is what I actually want.

    Thanks in advance for any ideas or help.

    #95114

    I haven’t fully understood what your issue is with the Optimiser, but I’ve had weird stuff happening all day!

    The Optimiser will not / does not give me results for Gain other than the Gain which the System shows without the code / variables I am trying to Optimise.

    To put it another way … it’s like the System is as good as it can get and the extra conditions / variables that I have added can only make the Gain lower so the Optimiser comes up with all variable combinations that make no difference / don’t exist during the 100k bars I was Optimising over.

    Hope that makes sense.

    #95115

    Maybe your indicator has a “division by zero” issue, or uses non integer values or values < 1, say with HIGHEST or similar.

     

    1 user thanked author for this post.
    #95116

    Why do you call the indicator twice? You only need to call it once like this:

    If you want to check that it has been in bear territory for a set number of bars then you need to use SUMMATION:

     

    1 user thanked author for this post.
    #95133

    Right, I’m not sure why yours is behaving like that GraHal?

    Mine, it turns out didn’t like the date range Aug 2010 to Oct 2017, but when I optimise the system for the Trump rally Nov 2016 to Jan 2018 it optimises and shows 149 days is optimal time to hold before exiting a trade and produces 30k profit BUT… then I use 120 days as it seems to be a number the optimisation results are missing and don’t have a value for (pls see Excel screenshot) and the system makes £100k?

    Why does it have “missing” values between 1 and 300 days?

    So I set it to exactly 149, the “optimal” nos. of days to exit the trades, (12 of them) and again I get a higher profit (£105k Gain).

    I’ve not seen or noticed the Optimiser do this before? Can anyone figure out what it’s doing or why as the code seems “simple” enough?

    Cheers.

    #95136

    Thanks for making the code more efficient Vonasi and showing me that Summation code! This “buy on the Bear spike” with the strategy profit trade size algo did £159k on the Dax – same dates – with 38% Drawdown, typical of trend following systems. See attached. The trade exit = 100 days was a random figure and the first I tried.

    Kempen’s head of asset allocation said he had observed that several pension funds had already switched to quarterly rebalancing. However, he argued that rebalancing only once a year would be more beneficial in may cases.

    https://www.ipe.com/countries/netherlands/less-frequent-rebalancing-would-benefit-pension-funds-say-managers/www.ipe.com/countries/netherlands/less-frequent-rebalancing-would-benefit-pension-funds-say-managers/10021831.fullarticle

    I’m not saying there is a link it was just something I read.

    #95138

    Cheers.
    Do you mean like Line 11: Offset = 0.85? Would that cause a problem is a system optimisation that uses an indicator with a value less than zero?
    I’ve not heard of the “division by zero” issue, what is that, or am I experiencing it right now!?

    https://www.prorealcode.com/topic/help-creating-bull-market-indicator-with-a-custom-indicator/#post-94934

    #95251
    c2 = (summation[a](indicator1 = 1) = a)

    Hi @Vonasi,

    When I tested the Summation optimisation as above it produced no trades? Pls see image.
    If I remove the = a but keep the last bracket it works.. for a while then I get the optimisation error? (Roberto was referring above to some issues being the possible cause of the optimisation problem. I’m still not sure what it is exactly about this system though that stops it being optimised half way through? The Bull/Bear indicator code has an offset value of 0.85?

    Do you or anyone else know why it seem to optimise and then at other times not? The system below in this post optimised okay, but the one in post https://www.prorealcode.com/topic/optimisation-fails/#post-95102

    won’t optimise? I have tried two version of the indicator one with the 20% condition and one without but that makes no difference it still won’t optimise…

    Ideally I want to be able to optimise the number of days for a Bear before entering and the number of days before exiting (from 1 to 100 days) but can’t?

    Cheers,

     

    #95338

    Now I can’t optimise this benchmark system below either (which Im using to compare to the performance of the Bull/Bear 20% System above) :

    Do you know what is going on with PRT’s optimisation engine @nicolas as I just successfully optimised the same system (using a different parameter (most profitable number of days needed to exit)?

    Cheers for any insights,

    #95343

    If you get an error during a optimization run then it is usually due to poor internet. I know this because I ‘borrow’ my internet from a bar just behind my boat and on Saturdays and Sundays when the bar is full of people staring at their mobile phones and the internet is slow I can’t optimize anything without getting the error that you showed earlier.

    As for your optimizations showing zero for all the results this is usually because either the entry criteria is never met or the exit criteria is never met so it has a trade or trades open but never closes them and so never makes a profitable trade to show you in the results. You need to GRAPH c1 and c2 to see if your entry conditions are ever met.

    2 users thanked author for this post.
    #95356

    Thanks so much Vonasi, it’s been really hit and miss back testing lately! And thanks for the tip with the graphing. 👌

    #95421

    Yeah.. it’s not the internet connection and the backtest fails half way through optimisation 100% of the time because of the Bull Bear ALMA indicator being used on the Entry. I just used another entry and it will optimise the number of days before exiting the position.

    Does anyone know what specifically is causing the issue with the indicator?

    Thanks,

     

     

    #95425

    fails half way through optimisation 100% of the time because of the Bull Bear ALMA indicator being used on the Entry

    Does it also fail on 10,000 or 5,000 or 1,000 bars etc?

    1 user thanked author for this post.
    #95432

    Yeah cheers @GraHal, it’s not the bar length it’s definitely the Bull/Bear ALMA as it worked on 5000 units using a generic entry like (DOpen(0) < DClose(1)) for entry instead of that indicator. It seems really hit or miss if it’ll work or not… I’m even trying different old systems and they’re also not optimising. The only thing that is different is I’m using wi-fi in a hotel. I will wait until I’m home later and test again using Ethernet because this is wasting an extraordinary amount of time!

    Did you sort your gremlins out?

    #95433

    Did you sort your gremlins out?

    No I had to go on Mothers day outings on Sunday and I’ve not looked at it since! 🙂

    Sometimes we need to be forcible pulled away from problem solving as often ones brain comes up with solutions or at least alternatives to try while we are doing other tasks?

Viewing 15 posts - 1 through 15 (of 20 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login