Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to backtest compounding strategy?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to backtest compounding strategy?

    Hey, just wondering how I can backtest a strategy by trading compounding interest. So for example instead of just buying a fixed number of shares, I'd like to adjust forward the number of shares bought by the relative change in the capital from the previous trade. So if I make $200 on $30,000, I trade with $30,200 the next time to buy slightly more shares than with my original 30.

    #2
    Hello Andy23,

    Thank you for your note.

    Attached are 4 samples which adjust trade size based off account size. The strategy titled BuyXSharesBasedOnAccountSizeRefactored2WorkWithBac ktests, will work with backtests.

    Please let us know if you have any questions.
    Attached Files
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Day trading realistic expectations

      Thanks for your help!

      Comment


        #4
        Originally posted by NinjaTrader_AlanP View Post
        Hello Andy23,

        Thank you for your note.

        Attached are 4 samples which adjust trade size based off account size. The strategy titled BuyXSharesBasedOnAccountSizeRefactored2WorkWithBac ktests, will work with backtests.

        Please let us know if you have any questions.
        Your code is NT8. This is the NT7 forum.

        Comment


          #5
          Hello koganam,

          Thank you for pointing that out.

          I do not have equivalent for NT7.

          Please let us know if you need further assistance.
          Alan P.NinjaTrader Customer Service

          Comment


            #6
            Do you have an updated example for this?

            Comment


              #7
              Hello LateButEarly,

              Thanks for your notes.

              We do not have a NinjaTrader 7 equivalent script for this.

              The example script linked by NinjaTrader_AlanP in post # 2 is the most up to date version of this example and will import into the current version of NinjaTrader 8 (8.1.1.7) successfully.

              Please let us know if we may assist further.

              <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by sjsj2732, Today, 04:31 AM
              0 responses
              20 views
              0 likes
              Last Post sjsj2732  
              Started by NullPointStrategies, 03-13-2026, 05:17 AM
              0 responses
              280 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              279 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              130 views
              1 like
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              90 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Working...
              X