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 Noerclou, Today, 04:55 AM
|
0 responses
1 view
0 likes
|
Last Post
by Noerclou
Today, 04:55 AM
|
||
Started by llanqui, Yesterday, 09:59 AM
|
2 responses
16 views
0 likes
|
Last Post
by llanqui
Today, 04:00 AM
|
||
Started by ThoriSten, Today, 03:56 AM
|
0 responses
6 views
0 likes
|
Last Post
by ThoriSten
Today, 03:56 AM
|
||
Started by PhillT, 04-19-2024, 02:16 PM
|
3 responses
20 views
0 likes
|
Last Post
by mangel2000
Today, 03:04 AM
|
||
Started by TraderBCL, Today, 02:37 AM
|
0 responses
4 views
0 likes
|
Last Post
by TraderBCL
Today, 02:37 AM
|
Comment