Money management snippet

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #70501 quote
    Inertia
    Participant
    Master

    Hi all !

    Months ago i found this “mm” snippet on this precious forum.

    Q: I had to stop the strategy to tweack this last one a bit…

    Then, I put it back on live but the balance was gone, like back to square 1.

    Any ideas anyone may have to solve this problem ?

    I do deeply understand that it may be the “happy hour” for some of you so no rush, CHEERS !

    Thx.

    once startpositionsize=1
    once positionsize=startpositionsize
    once flatoverweekends=1
    once startequity=0
    once Reinvest=1
     
    if reinvest then
    //------------ Fixed fraction money management ----------
    once multiplier=1
    once delta=200 // < == THROTTLE
    once fraction=delta*pipvalue
    once newlevel=delta*pipvalue
    once oldlevel=delta*pipvalue
    if strategyprofit+startequity>newlevel then
    multiplier=multiplier+1
    oldlevel=newlevel
    newlevel=strategyprofit+startequity+multiplier*fraction
    positionsize=multiplier*startpositionsize
    elsif strategyprofit+startequity<oldlevel and multiplier>=2 then
    newlevel=strategyprofit+startequity
    oldlevel=strategyprofit+startequity-multiplier*fraction
    multiplier=multiplier-1
    positionsize=multiplier*startpositionsize
    endif
    Endif
    
    if flatoverweekends then
    //--------------- daylight-saving corrections ------------------
    if currentmonth=3 and day>=15 then
    dlc=10000
    elsif currentmonth=11 and day<8 then
    dlc=10000
    else
    dlc=0
    endif
    
    fridaynight=(currentdayofweek=5 and time>=(223000-dlc))
    else
    fridaynight=0
    endif
    
    if fridaynight then
    if longonmarket then
    sell at market
    elsif shortonmarket then
    exitshort at market
    endif
    endif
    
    #70505 quote
    Nicolas
    Keymaster
    Master

    Change the “startequity” variable with the profit already made by the strategy.

    Inertia thanked this post
    #70508 quote
    Inertia
    Participant
    Master

    Thank you for your swift answer Nicolas (as usual)! Much appreciated 😉

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

Money management snippet


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
Inertia @inertia Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Inertia
7 years, 9 months ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 05/15/2018
Status: Active
Attachments: No files
Logo Logo
Loading...