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