PDA

View Full Version : Drawdown calculation


lgarcia3
04-05-2008, 06:17 PM
How can I calculate the drawdown after entering a trade in a strategy?
Thanks!

NinjaTrader_Josh
04-05-2008, 07:49 PM
Try the TradesPerformance property.
Performance.RealtimeTrades.TradesPerformance.Curre ncy.DrawDown

timmyb
04-06-2008, 09:35 PM
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

NinjaTrader_Josh
04-06-2008, 09:42 PM
It depends on what you want to do. If you want all trades use the AllTrades instead of RealtimeTrades.

timmyb
04-06-2008, 10:12 PM
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

NinjaTrader_Josh
04-06-2008, 11:24 PM
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 :D. 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.

lgarcia3
04-11-2008, 03:31 PM
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!

NinjaTrader_Josh
04-11-2008, 11:54 PM
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.

Serninja
08-19-2010, 10:02 AM
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!

NinjaTrader_RyanM
08-19-2010, 10:44 AM
Hello SerNinja,

Thank you for sharing this link and offering the suggestion. I will forward on to our development team.