Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How to reinvest your winnings?
Collapse
X
-
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. -
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
-
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
-
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
-
Originally posted by NGorodzhiy View PostWhen 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 CaptainJack, 05-29-2026, 05:09 AM
|
0 responses
374 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 05:09 AM
|
||
|
Started by CaptainJack, 05-29-2026, 12:02 AM
|
0 responses
242 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 12:02 AM
|
||
|
Started by charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
207 views
1 like
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
293 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
253 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|

Comment