I now want my Drawdown percentages to be displayed in a window or anywhere
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
my Drawdown percentages
Collapse
X
-
Hello salaski1,
Thanks for your post.
It would not be possible to get the drawdown percentage in a strategy using the Strategy Builder.
To access this you would need to unlock the code from the Strategy Builder and manually program this logic into your script.
In an unlocked script, you could access the Drawdown from the TradesPerformance collection. Then, you could save the Drawdown value to a variable and use something like Draw.TextFixed() to draw the value on a chart.
See the help guide documentation below for more information.
Drawdown: https://ninjatrader.com/support/help...8/drawdown.htm
TradesPerformanceValues: https://ninjatrader.com/support/help...ancevalues.htm
TradesPerformance collection: https://ninjatrader.com/support/help...erformance.htm
Draw.TextFixed: https://ninjatrader.com/support/help..._textfixed.htm
Let us know if we may assist further.<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
Comment
-
I did it but it doesn't show upOriginally posted by NinjaTrader_BrandonH View PostHello salaski1,
Thanks for your post.
It would not be possible to get the drawdown percentage in a strategy using the Strategy Builder.
To access this you would need to unlock the code from the Strategy Builder and manually program this logic into your script.
In an unlocked script, you could access the Drawdown from the TradesPerformance collection. Then, you could save the Drawdown value to a variable and use something like Draw.TextFixed() to draw the value on a chart.
See the help guide documentation below for more information.
Drawdown: https://ninjatrader.com/support/help...8/drawdown.htm
TradesPerformanceValues: https://ninjatrader.com/support/help...ancevalues.htm
TradesPerformance collection: https://ninjatrader.com/support/help...erformance.htm
Draw.TextFixed: https://ninjatrader.com/support/help..._textfixed.htm
Let us know if we may assist further.
Comment
-
Hello salaksi1,
Thanks for your note.
To clarify, when you run your strategy do you see the Print appear in a New > NinjaScript Editor window?
Prints will only print information to a NinjaScript Output window. It does not print information on the chart.
To print information on the chart, you would need to create a double variable, assign the drawdown value to that double variable, and then call a Draw method such as Draw.TextFixed() to draw that variable value on the chart.
See the help guide documentation in my previous post for more information.
Also, see this attached example script which is a modified version of the SampleMACrossOver strategy that prints out the drawdown to the NinjaScript Output window.
Let us know if we may assist further.Attached Files<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
Comment
-
Hello salaksi1,
Thanks for your note.
You would need to assign the drawdown amount to that variable in OnBarUpdate() and then use that variable in something like a Draw.TextFixed() method to have the drawdown value drawn on a chart window.
For example, to assign the drawdown value to your 'draw' variable the code might look something like this:
draw = SystemPerformance.AllTrades.TradesPerformance.Curr ency.Drawdown;
Then, you would use the 'draw' variable when calling Draw.TextFixed.
Draw.TextFixed(this, "tag1", draw.ToString(), TextPosition.TopRight);
I have attached a modified version of SampleMAPrintDrawdownExample here which you could reference. This modified example assigns the drawdown to a variable and uses that variable when calling Draw.TextFixed().
See the help guide documentation below for more information and sample code.
Draw.TextFixed(): https://ninjatrader.com/support/help..._textfixed.htm
Basic Syntax: https://ninjatrader.com/support/help...sic_syntax.htm
Basic Programming Concepts: https://ninjatrader.com/support/help...g_concepts.htm
Note that assigning values to a variable and using that variable in a method would be considered C# education assistance. In the support department, we do not provide C# programming education services. This is so that we can maintain a high level of service for all of our clients as well as our partners. To get a better understanding of how to assign values to variables and use those variables in a method, you could do a quick Google search for something like 'C# assigning value to variable' or 'C# use variable in a method' to find educational C# information and examples.
Let us know if we may assist further.Attached Files<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
56 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
132 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
73 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
45 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
49 views
0 likes
|
Last Post
|

Comment