Increase/Decrease contracts based on total capital?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #157090 quote
    umebonumebon
    Participant
    Average

    Hi

    Is it possible to make a MM in a system that increases/decreases contracts based on total capital?
    Say if my initial capital is 10000 and I want too risk 0.01 of that in trades. If I have a winning trade I want the capital to be updated to the actual amount on my account so that MM updates and increase the number of contracts if possible.

    #157092 quote
    NobodyNobody
    Participant
    Veteran
    // dynamic position sizing  n = position size
    
    capital = 10000
    n = (10000/close + strategyprofit/close) * coef
    
    // adjust n by whatever coeeficient give you the leverage/ exposure that is comfortable risk parameter   coef = leverage adjusment
    umebon thanked this post
    #157099 quote
    J.J.
    Participant
    Average

    The way I do it is like this:

     

    STARTINGCAPITAL = 10000 //10k USD
    
    SIZE = 1 / STARTINGCAPITAL //divide your initial contract size by startingcapital
    
    CAPITAL = STARTINGCAPITAL + STRATEGYPROFIT //current capital
    CONTRACTS = CAPITAL * SIZE //calculate position size

    But you have to explicitly close the positions to update your strategyprofit by selling or exitshorting, and then you can open a new position.

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

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Increase/Decrease contracts based on total capital?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
umebon @umebon Participant
Summary

This topic contains 2 replies,
has 3 voices, and was last updated by J.J.
5 years, 8 months ago.

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