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 andrewtrades, Today, 04:57 PM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by chbruno, Today, 04:10 PM
            0 responses
            6 views
            0 likes
            Last Post chbruno
            by chbruno
             
            Started by josh18955, 03-25-2023, 11:16 AM
            6 responses
            436 views
            0 likes
            Last Post Delerium  
            Started by FAQtrader, Today, 03:35 PM
            0 responses
            9 views
            0 likes
            Last Post FAQtrader  
            Started by rocketman7, Today, 09:41 AM
            5 responses
            20 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X