If I could ask for just two things for NT7, it would be support for custom performance metrics (so I can add monthly Sortino, SQN, a real Sharpe ratio [including unrealized gains], average rolling monthly/yearly returns, etc.) and more built-in position sizing algorithms (including a base class to add custom ones).
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Position Sizing Custom Code
Collapse
X
-
Position Sizing Custom Code
Has anyone developed any position sizing code that you could add to a strategy base class (@Strategy.cs or your own custom base class) and then be available to all descendant strategies. I was thinking about at least having a position sizing option based on % of current account value (starting account value + realized gains, not % of starting account value as NT has built-in) and maybe a few others such as a % of Optimal-F, a % of Kelly F, or fixed $ invested (allowing fractional shares).
If I could ask for just two things for NT7, it would be support for custom performance metrics (so I can add monthly Sortino, SQN, a real Sharpe ratio [including unrealized gains], average rolling monthly/yearly returns, etc.) and more built-in position sizing algorithms (including a base class to add custom ones).Last edited by Anagoge; 04-20-2009, 01:18 AM.Tags: None
-
Maybe this help a little http://www.ninjatrader-support2.com/...ad.php?t=11614Originally posted by Anagoge View PostHas anyone developed any position sizing code that you could add to a strategy base class (@Strategy.cs or your own custom base class) and then be available to all descendant strategies. I was thinking about at least having a position sizing option based on % of current account value (starting account value + realized gains, not % of starting account value as NT has built-in) and maybe a few others such as a % of Optimal-F, a % of Kelly F, or fixed $ invested (allowing fractional shares).
If I could ask for just two things for NT7, it would be support for custom performance metrics (so I can add monthly Sortino, SQN, a real Sharpe ratio [including unrealized gains], average rolling monthly/yearly returns, etc.) and more built-in position sizing algorithms (including a base class to add custom ones).
-
Yes, I would love to be able to add several custom strategy analyzer metrics to the result grids for backtests and optimizations and also have some more expansive built-in position sizing algorithms and/or a base class to add custom position sizing algorithms that would be selectable in any strategy.
PRTester, I'll look at your position sizing code. It might be a good place to starting place to start implementing something close to what I need.
Comment
-
Yes, exporting to a file works, but I'd definitely rather be able to see the metrics inside the GUI and sort the optimizer grids by my custom metrics, etc. A tool similar to NT that I've used allows adding custom metrics to both individual trades and the strategy results using a method called AddCustomMetric. These custom metrics show up in the backtest/optimize result grids and can be sorted/filtered/exported/graphed just like the built-in metrics. I find this feature very powerful.
Comment
-
I gave this a look and it helps. I managed to hack your code to implement percentage of current account size (0-100%) position sizes, and it helps in some sense, but there are still some issues. Because the account balance compounds (grows exponentially) now, the growth of the account in dollars graph needs to be a log scale, and the performance measures like cumulated profit should really be changed to the more commonly quoted cumulative profit of the actual account balance, but since we can't add custom performance measures to NT, this change was only a small win for me. That said, at least I learned a little more about the features and limitations of NT.Originally posted by PrTester View PostMaybe this help a little http://www.ninjatrader-support2.com/...ad.php?t=11614
[I'm aware of the dangers of backtesting/optimizing using cumulative profit type statistics, but I mainly need this number when showing a potential strategy to someone else who wants to see these statistics.]
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
648 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
369 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
108 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
572 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
573 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment