Assemble two money management codes

Forums ProRealTime English forum ProOrder support Assemble two money management codes

Viewing 9 posts - 1 through 9 (of 9 total)
  • #45133

    Hello could help me these two MM codes to build that they function with each other

     

    1.

    once multiplier=1
    once fraction=1000
    once newlevel=1000
    once oldlevel=1000
    once startpositionsize= 10
    once positionsize=startpositionsize
    if sp>newlevel then
    multiplier=multiplier+1
    oldlevel=newlevel
    newlevel=sp+multiplier*fraction
    positionsize=multiplier*startpositionsize
    elsif sp<oldlevel and multiplier>=2 then
    newlevel=sp
    oldlevel=sp-multiplier*fraction
    multiplier=multiplier-1
    positionsize=multiplier*startpositionsize
    endif

     

    2.

    once os=positionsize //3 // ordersize – can be any number depending on account size;

    once osa=os

    once teilung=1// 1.5 //1.5 reducing the ordersize after winning trade

    once ff=3 //increasing ordersize after losing trade;

    once maxcon=ff*os //ff*ff*os+os// defining the maximum ordersize;

     

    if strategyprofit<strategyprofit[1] then // increasing ordersize when losing
    os=os*ff
    if os>maxcon then
    os=maxcon
    endif
    start=1
    endif

    if strategyprofit>strategyprofit[1] then // decreasing ordersize when winning
    start=1
    os=os/teilung
    if os<osa then
    os=osa
    endif

    #45163

    he second code is to double after a loss the position size until the capital has reached the last highest level before the loss.

    an example

    start 1000

    trade profit with 10 positions1100
    trade profit with 10 positions 1200
    trade profit with 10 positions 1300
    trade loss with 10 positions 1100
    trade loss with 20 positions 700
    trade profit with 20 positions 900
    trade profit with 20 positions 1100
    trade profit with 20 positions 1300 (> 1300) = last highest score
    next trade again with 10 positions

    #45217

    The first looks like an old version of my fixed fraction MM. I raised it since then to calculate correctly also when start equity is <>0. Now you ask for the code for a martingale. I code this long ago. Haven’t looked at the code for a long time so there might be an error inside (but maybe not). Here you go:

     

    #45256

    I thank you you really does a very good work here in the forum, I hope I can help you synonymous times

    #45258

    I still have problems with the code,

    my first question is what do I do with the variable martingale?

    with maxpositionsize I could set it that the code me doubled only once the old capital is reached, then I can use in however no longer with the first code

    the last is the still works but still not with the first code it no positions increased after the adjusted capital gain (eg 1000 as adjusted)

    #45261

    so simply said I would have the increase of the position size after a loss only once to reach the old peak level is synonymous if several losses come in series, and I just do not understand why it no longer with the here first code to increase the positions after reach the Capital gains.

     

    I would also have an idea, I believe it would be better positions to increase point gains not for money gains, which would somehow look like strategyprofit divided by position size?

    #45262

    The two codes are not thought to work together. The martingale is reseting the position size to startpostionsize. You will have to change this to make it work. Then I haven’t thought through if this two codes work together or if there are other problems.

    The martingale variable is only a switch turn it on/off.

    For the money management better use this revised code:

     

    #45294

    thank you but it is not really what I was looking for

    #45311

    I’m aware of that. This is a revised version of one of the two codes you want to combine and I recommended you to take this version for your affords.

    Then I don’t see an advantage of using points instead of profit. points*pointvalue=strategyprofit and since pointvalue is a constant it doesn’t really make a difference if you use points or profit.

Viewing 9 posts - 1 through 9 (of 9 total)

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