Help with money management

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #106071 quote
    Fran55
    Participant
    Veteran

    Please… I need this part of Code.

    If capital is Cross Up 10000€ the Next operations as to 3€.

    But, if capital is Cross down 10000€ the Next operations as to 1€.

    Thanks!

    #106079 quote
    Vonasi
    Moderator
    Master
    capital = 10000
    equity = capital + strategyprofit
    
    if equity > capital then 
    positionsize = 3
    else
    if equity <= capital then
    positionsize = 1
    endif
    endif
    
    if (your conditions) then
    buy positionsize contracts at market
    endif

    The above simply changes between position size of 3 or 1 depending upon if you are above or below 10k. Is this what you mean as your description is not very clear?

    #106080 quote
    Vonasi
    Moderator
    Master

    Another possibility:

    capital = 10000
    equity = capital + strategyprofit
    once lastchange = capital
    once positionsize = 1
    
    if equity > lastchange + 10000 then 
    positionsize = positionsize * 3
    lastchange = lastchange + 10000
    else
    if equity < lastchange - 10000 then
    positionsize = max(1,positionsize / 3)
    lastchange = lastchange - 10000
    endif
    endif
    
    if (your conditions) then
    buy positionsize contracts at market
    endif

    This version multiplies position size by 3 every time a new 10k profit is reached and divides it by 3 every time 10k is lost down to a minimum size of 1.

    Not tested.

    EDIT:2019/09/04. MIN in line 11 should have been MAX – I have edited the post to correct this.

    #106228 quote
    Fran55
    Participant
    Veteran

    Thanks Vonasi!

    The first publicatión is valid.

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

Help with money management


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Fran55 @fran55 Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by Fran55
6 years, 6 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 09/01/2019
Status: Active
Attachments: No files
Logo Logo
Loading...