Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to reinvest your winnings?

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

    How to reinvest your winnings?

    When I backtest I want to reinvest my winnings into my next position. How do I do this? Thank you.

    #2
    Hello NGorodzhiy,

    Thank you for your post.

    You will need to use AccountSize to start a set account value. The orders would then get dynamically adjusted per how much this account would have.
    http://www.ninjatrader.com/support/h...ccountsize.htm

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      How do I tell NT to invest all the cash into one instrument? And what if I want to invest in multiple instruments and I want to divide my cash evenly?

      Comment


        #4
        NGorodzhiy,

        The concept of re-investing is handled by the AccountSize for this.

        However,. this is only valid of single instruments. For Multiple instruments you would need to track and report them individually
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          One I use AccountSize for example, if I start with $10,000 and on the first position I profit $1,000. When entering my second position will the $1,000 I profited from my first position be reinvested automatically? Thank you.

          Comment


            #6
            Originally posted by NGorodzhiy View Post
            When I backtest I want to reinvest my winnings into my next position. How do I do this? Thank you.

            I use this in my code, I take the original position size, in my case 10,000 units and add 1% of the account size gain to the next position size.

            My code changes the DefaultQuantity amount.

            Something like this may help. accperc is a variable on the strategy to allow you turn it on and off dynamically. Add cAmount to your DefaultQuantity. Even add accpercamount as a percentage to alow how much of your account to increase the total.

            Code:
            if(accperc)
            {
            	accpos = GetAccountValue(AccountItem.CashValue);
            	cAmount = Convert.ToInt32(GetAccountValue(AccountItem.CashValue) * accpercmaount);
            }

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Noerclou, Today, 04:55 AM
            0 responses
            1 view
            0 likes
            Last Post Noerclou  
            Started by llanqui, Yesterday, 09:59 AM
            2 responses
            16 views
            0 likes
            Last Post llanqui
            by llanqui
             
            Started by ThoriSten, Today, 03:56 AM
            0 responses
            6 views
            0 likes
            Last Post ThoriSten  
            Started by PhillT, 04-19-2024, 02:16 PM
            3 responses
            20 views
            0 likes
            Last Post mangel2000  
            Started by TraderBCL, Today, 02:37 AM
            0 responses
            4 views
            0 likes
            Last Post TraderBCL  
            Working...
            X