Compounding buys in trading system

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #153176 quote
    rush1884
    Participant
    New

    Hi,

    I was wondering if anyone knew how to use the trading system so that every time I make a trade the trade investment is as a proportion of my portfolio value not an arbitary £/point. Obviously when backtesting a system i want to see how the effects of compounding has. If I look over a 10 year period and my starting buy level is £1/point (reflecting a 20% portfolio investment) this can become very small as the portfolio increases in value by say year 5 where the £1/point only equates to a 5% portfolio investment.

    If you could help that would be great, if you are unsure what I mean then please let me know.

    Chris

    #154677 quote
    robertogozzi
    Moderator
    Master

    This code will show you (in the variable window pf ProBacktest), the percentage of your investement compared to the beginning.

    The percentage increases when you  lose and decreases as you gain. In this case at the end your investment is 83.5% compared to a starting 100%:

    DEFPARAM CumulateOrders = false
    ONCE tp        = 50
    ONCE MA        = 600
    ONCE MyCapital = 10000
    ONCE LotSize   = 1
    MyEquity       = MyCapital + StrategyProfit
    MyInvestment   = MyCapital / MyEquity
    if close crosses over average[MA] then
       buy LotSize Contracts at market
    set target pprofit tp
    endif
    if close crosses under average[MA] then
       sellshort LotSize contracts at market
    set target pprofit tp
    endif
    graph (MyInvestment * 100) AS "PerCent"
    x-6.jpg x-6.jpg
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Compounding buys in trading system


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
rush1884 @rush1884 Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzi
5 years, 2 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 12/10/2020
Status: Active
Attachments: 1 files
Logo Logo
Loading...