Thanks!
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Drawdown calculation
Collapse
X
-
Am i correct to assume that line of code works teh same as the previous profit code. As in if i wanted the strategy to run until max drawdown of 3 points was met. IE it reaches 10 points profit and the loses 3 points. it would then stop trading. Or is that line just dependent upon the current trade?
thanks again
Tim
Comment
-
But using the alltrades with the drawdown code would make it be a daily profit to a certain drawdown correct?
Thanks again Josh, the team here is unbeleivable. Even by using your time wisely all of you have helped an enormous amount of people. I notice you are on quite often and i suppose this is one of you many jobs. I am curious to know if you are an active trader. One other question i have is obvioulsy you are a expert at C sharp, I for one am not but am curious if you have any reference for one to learn. If you were not school taught I am curious of any sources you used to learn. I hope to give back to this forumn the best i can.
Thanks again
Tim
Comment
-
If you use AllTrades it will give you the final drawdown up to that point in the strategy. If you are trying to get the drawdown for the latest trade you will need to create your own variables and track them to determine the drawdown. Have a variable that sets itself to as low as your trade goes and one that sets itself to as high as the trade goes. Then after you exit the trade compare the two and determine the drawdown manually.
Thank you for your kind words. Unfortunately I am currently not an active trader, but would love to be . I learned C# mostly from just looking at what others do. Try small things here and there and then eventually move up to making my own things. Google was a great resource that contains many useful links to various coding techniques and things. MSDN is also extremely useful for finding all the syntax you need on various properties and methods.Josh P.NinjaTrader Customer Service
Comment
-
When calculating the drawdawn, does it return a negative number if going against the trade or just a number? How does it work? Also, what is the difference between using RealTime trades and Performance.LongTrades or Performance.ShortTrades? I see a lot of potential with this application, do you guys have a training sessions for developers? or a book for sale on how to program it?
Thanks!Last edited by lgarcia3; 04-11-2008, 03:38 PM.
Comment
-
Off the top of my head I believe the drawdown does show negative numbers when appropriate, but don't quote me on that. When you limit it to RealTime trades only on the performance object you essentially are only calculating your statistic based on trades you did in real time. The filter essentially removes all the simulated trades your strategy would have done while cycling through historical data when you start up the strategy.
We do not have a programming class as of currently, but we do have a class for development with the NinjaScript Strategy Wizard. Please see the link in my signature.Josh P.NinjaTrader Customer Service
Comment
-
"Runup &Drawdown of Each Trade"
Hello,
I just wanted to make a suggestion. I have seen this "Runup & Drawdown of Each Trade" visualization on the chart.
I've got it from this link: http://www.meyersanalytics.com/parabcht.php
Like for instance when you click on the trades in the execution list to show it on the chart where one can already see the connected lines between the trades this could help for making a better visualization of the "Runup & Drawdown" statistics.
Thanks!
Comment
-
-
Hello ninjo,
According to the NinjaTrader 7 Help Guide,
Originally posted by http://ninjatrader.com/support/helpGuides/nt7/drawdown.htmDefinition
Returns the draw down of the collection.
Property Value
A double value that represents the average ETD of the collection.
Syntax
<TradeCollection>.TradesPerformance.<TradesPerfo rm anceValues>.DrawDown
Examples
protected override void OnBarUpdate()
{
// Print out the draw down of all trades in currency
Print("Draw down of all trades is: " + Performance.AllTrades.TradesPerformance.Currency.D rawDown);
}
Originally posted by https://ninjatrader.com/support/helpGuides/nt7/?statistics_definitions.htmAverage ETD
This statistic returns a value that is useful in giving you a measure of how effective your exit conditions capture the price movements after your strategy enters a position. It shows you how much you give back from the best price reached before you exit the trade. A small number here is generally desirable since it would imply highly optimized exit conditions that capture most of the price movement you were after.
Currency
Average MFE – Average Trade
Percent
Average MFE – Average Trade
Points
Average MFE – Average Trade
Please let us know if we can be of further assistance.Last edited by NinjaTrader_JessicaP; 04-27-2016, 07:20 AM.Jessica P.NinjaTrader Customer Service
Comment
-
The following should provide you with a running average of average drawdowns. In tests, the value decreased over time as drawdown decreased, which is evidence that the value returned by that property is the current average, and not maximum, drawdown.
Code:[FONT=Courier New] private double averageDrawDown = 0; /// <summary> /// Called on each bar update event (incoming tick) /// </summary> protected override void OnBarUpdate() { //if (! Historical) //{ averageDrawDown = 0 == averageDrawDown ? Performance.AllTrades.TradesPerformance.Currency.DrawDown : (Performance.AllTrades.TradesPerformance.Currency.DrawDown + averageDrawDown) / 2 ; Print("average drawdown: " + averageDrawDown); DrawHorizontalLine("AverageDrawDown", averageDrawDown, Color.RoyalBlue); //} // your code here }[/FONT]
Jessica P.NinjaTrader Customer Service
Comment
-
Thank you for the message but the result of this code is the same. The Maximun DrawDrown
Performance.AllTrades.TradesPerformance.Currency.D rawDown
Some programmer of NT could help me to get the value of the DD average drawed as a blue line in the graphic of the DD Historical Performance?
Thank you
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Aviram Y, Today, 05:29 AM
|
0 responses
1 view
0 likes
|
Last Post
by Aviram Y
Today, 05:29 AM
|
||
Started by quantismo, 04-17-2024, 05:13 PM
|
3 responses
25 views
0 likes
|
Last Post Today, 05:23 AM | ||
Started by ScottWalsh, 04-16-2024, 04:29 PM
|
7 responses
34 views
0 likes
|
Last Post Today, 05:15 AM | ||
Started by cls71, Today, 04:45 AM
|
0 responses
6 views
0 likes
|
Last Post
by cls71
Today, 04:45 AM
|
||
Started by mjairg, 07-20-2023, 11:57 PM
|
3 responses
216 views
1 like
|
Last Post
by PaulMohn
Today, 04:22 AM
|
Comment