MAE maximisation

Tagged: , ,

Viewing 12 posts - 1 through 12 (of 12 total)
  • #143431

    Hi guys,

    I’ve been immersed in my bots for the past few weeks so apologies if the answer is already covered in the forum, I’m going to catchup on the threads this evening.

    I have fine tuned an autotrading bot for good profit but I’m looking for a way to maximise the missed out MAE when I have a set take profit figure considering the trailing stop loss doesn’t kick in with my broker IG only the set stop loss.

    All suggestions welcome and very much appreciated.

    Thanks in advance,

    Kovit

    #143510

    Take the average of MAE and use it as a dynamic takeprofit.

    1 user thanked author for this post.
    #143640

    That sounds easy, but I struggled & failed to code it. Could you show us how it’s done properly to calculate an average of the maximum favorable excursion from all trades done? I question if it should be separated for long & short. It could be a very usefull snippet!

    1 user thanked author for this post.
    #143648

    You just need to use SET STOP $LOSS  var with the variable var , it’s simplier

    It will be the same think as finding the best MAE

    For example the cut in this backtest is at 2500 USD

    But remember, it’s one more variable = more overfitting 😉

    2 users thanked author for this post.
    #143693

    The 2D chart is indeed a good way to find the average of the MFE, good spot.

    I was thinking of a more dynamic way by calculating the average of MFE inside the strategy. Easier with array:

     

     

    2 users thanked author for this post.
    #143694

    Hmmm MAE or MFE? 🙄

    Sorry, I must be tired, my above code is the average MFE!!

    2 users thanked author for this post.
    #143702

    Thanks Nicolas,

    unfortunately I don’t have acces to v11 to test and I ‘am not familiar with variables.

    For my purpose I was looking at MFE. Having one example helps to create the other though.

    Your code covers a few problems I had, such as having a minimum number of trades before calculation can happen. However I don’t understand where the minimum of 10 orders is specified.

    It mentions mae (row19), is that correct because everything else is based on mfe?

    #143727

    yes sorry, I changed “isset($mfeArray[10])” with only 2 orders.

    BTW, as i said, it is a rough idea, while it computes correctly the average, if we have a takeprofit defined in the strategy, therefore the MFE is already known: it is the takeprofit value! Do you see what I mean?

    #143728

    V11 is free, open a free EOD account at prorealtime.com, you will be able to test…

    #143732

    Yes I understand, takeprofit is a static value. Will give it thought how to put it to good use. Thanks for the v11 EOD account tip!

    #148396

    Thank you everyone for all the input and responses and lol I must have been tired myself as I meant mfe not mae.

    #183524

    Bonsoir Nicolas, merci pour  ce code que je vais tester. Je ne m’y connais pas en Arrays. Est-ce que le code Long/short suivant est correct?

     

    Merci encore

Viewing 12 posts - 1 through 12 (of 12 total)
Similar topics:

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