Optimisation fail

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #66960 quote
    irioton
    Participant
    Average

    Hi all ! I’ve got some difficulties with the plateforme, I want to optimise 2 variables (“m” and “d” in the picture), from 1 to 100,  the others are fixed.

    “d” is tested, but “m” stays to 1. Did someone have that before ?

    Sans-titre.png Sans-titre.png
    #66964 quote
    Vonasi
    Moderator
    Master

    Normally it is because you have the value still fixed somewhere in your code so that it has no effect on the results. Either that or it is not used in the code at all.

    #66965 quote
    irioton
    Participant
    Average

    here is the code, both variables are used :

    //trailing stop function
    trailingstart = d //trailing will start @trailinstart points profit
    
    clow = (lowest[m](low))-tradeprice
    chigh= tradeprice-(highest[m](high))
    
    //reset the stoploss value
    IF NOT ONMARKET THEN
    newSL=0
    ENDIF
    //manage long positions
    IF LONGONMARKET THEN
    //first move (breakeven)
    IF newSL=0 AND close-tradeprice(1)>=trailingstart*pipsize THEN
    newSL = tradeprice(1)+1
    else
    SET STOP ptrailing 83
    ENDIF
    //next moves
    IF newSL>0 AND clow>trailingstart then
    newSL = newSL+clow*pipsize
    ENDIF
    ENDIF
     
    //manage short positions
    IF SHORTONMARKET THEN
    //first move (breakeven)
    IF newSL=0 AND tradeprice(1)-close>=trailingstart*pipsize THEN
    newSL = tradeprice(1)-1
    else
    SET STOP ptrailing 83
    ENDIF
    //next moves
    IF newSL>0 AND chigh>trailingstart then
    newSL = newSL-chigh*pipsize
    ENDIF
    ENDIF
     
    //stop order to exit the positions
    IF newSL>0 THEN
    SELL AT newSL STOP
    EXITSHORT AT newSL STOP
    ENDIF
    #67002 quote
    GraHal
    Participant
    Master

    Might sound daft but it can mean that ‘m’ at value 1 gives the highest gain?  Make m value fixed at 5 and see if gain reduces in the optimiser results?

    What is your range of values for m?

    PS / Edit~
    You may need a range with a much higher max value for d and m to get a optimised value other than 1 for m ??

    #67003 quote
    Nicolas
    Keymaster
    Master

    You should not multiply clow and chigh by pipsize at lines 21 and 35. Please try without.

    #67017 quote
    irioton
    Participant
    Average

    @GraHal : “d” and “m” are both tested from 1 to 100 with a step of 1


    @Nicolas
    : I did what you suggested, it doesn’t change the result, I still got an error message, but now it comes before the end of optimisation…

    #67018 quote
    irioton
    Participant
    Average

    I sent a message to prt, they said they’re going to look into it…

    #67023 quote
    Nicolas
    Keymaster
    Master

    What ‘error message’ !?

    Are you sure your ‘m’ variable is not set to a fixed value into the variables optimizations window?

    #67025 quote
    GraHal
    Participant
    Master

    If you put your full code on here then I will try it the optimiser for you?

    It is probably finger trouble / something daft that we have all done before also so we may spot it in your set up where we couldn’t see it when we made the same error!!! 🙂 🙂

    #67028 quote
    irioton
    Participant
    Average

    @Nicolas : yes i’m sure the values are not set to fixed. The error message just says there is an error, but not which one, that’s why I wrote to PRT.

    @GraHal : attached is the code untouched, yes could you optimise it for me please ?

    I would be glad if the error was mine, maybe you can find what’s wrong by testing it yourself.

    This is Dax 1 min.

    dax-moyenne-mobille-1mtrail.itf
    #67041 quote
    GraHal
    Participant
    Master

    Might sound daft but it can mean that ‘m’ at value 1 gives the highest gain?

    Apologies for delay, had to take my car for annual MOT! 🙂

    It’s what I said above.

    See attached for 10k bars and m is at different values
    See attached for 100k bars and m stays at vaue = 1
    See attached for 100k bars for m range 10 to 250 in step of 10 and m is at different values.

    Cheers
    GraHal

    irioton thanked this post
    10k-bars.jpg 10k-bars.jpg 100k-bars.jpg 100k-bars.jpg 100k-bars-10-to-250.jpg 100k-bars-10-to-250.jpg
    #67081 quote
    irioton
    Participant
    Average

    Thank you so much ! So I was worrying for nothing…This made me think about several things :

    • I can’t see the other possibilities in the report windows when I do the tests, is that normal ?
    • DO you have an error message too ?
    • my trailing highs/lows snippet doesn’t work, I have to work on it :s
    #67111 quote
    GraHal
    Participant
    Master

    I can’t see the other possibilities in the report windows when I do the tests, is that normal ?
    Yes I think we only see 100 results.

    DO you have an error message too ?
    No I got no error message but I didnt leave it running until it finished.

    My trailing highs/lows snippet doesn’t work, I have to work on it :s
    I agree.

    Rem out Nics stop and substitute a normal pstop and ptrailing to get a quick idea what values would work … I did and it was like 240 and 130 …  and even then overall gain was very low, but maybe I didn’t leave it running until optimiser completed?

    Just an idea I use sometimes
    GraHal

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.

Optimisation fail


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
irioton @irioton Participant
Summary

This topic contains 12 replies,
has 4 voices, and was last updated by GraHal
7 years, 11 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 04/02/2018
Status: Active
Attachments: 5 files
Logo Logo
Loading...