Money managment

Viewing 5 posts - 1 through 5 (of 5 total)
  • #106518

    Hi i was wondering how to create a code for money managment.

     

    Eksample: you start with 500$ with one lot size. When money doubles it will double the lot size to 2 and then when you double again it will add 4 lot sizes.

    It would be nice to have on the autotrading so i dont need to stop it to adjust my position.

     

    Thanks for the help 🙂 Stay green

    #106521

    Not tested. This code also reduces the size if you lose. Delete lines 9 to 13 if you don’t want to do that.

    1 user thanked author for this post.
    #106527

    Thanks i will try it out. Just one quick question. If im adding this to a strategy what do i den add in the  (your conditions)?

    Im not a good programer 🙁

    #106528

    A slightly better way to do it in my mind is like this:

    This does not double the position size but increments or decrements it by 1 for every 500 won or lost by a strategy down to a minimum stake size of 1.

    1 user thanked author for this post.
    #106558

    If im adding this to a strategy what do i den add in the  (your conditions)?

    Where ever you like above or below the money management code as long as it is below any DEFPARAM line.

    I had a chance to test my first example and there is a minor issue that if your strategy profit jumps from 500 to 1500 then you will have to wait for two bars before the position size is doubled twice. This might not be an issue on a strategy that makes small wins but on a long term buy and hold strategy that takes big profits or big losses then it might be.

    1 user thanked author for this post.
Viewing 5 posts - 1 through 5 (of 5 total)

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