NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Sunday May 26th at 12PM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 05-18-2009, 03:26 AM   #1
LazKz
Junior Member
 
Join Date: Feb 2009
Posts: 17
Thanks: 0
Thanked 0 times in 0 posts
Default Equity curve for strategy

Hello,
I would like to monitor the equity curve of a running strategy and compare it to its moving average. Can do that with creating a new DataSeries like follows?

#region Variables
private DataSeries equityCurve;
#endregion

protected override void Initialize()
{
equityCurve= new DataSeries(this);
}

protected override void OnBarUpdate()
{
equityCurve.Set(Performance.AllTrades.TradesPerformance.Points.Cum Profit);

if (equityCurve[1] > SMA(equityCurve,10)[1])
Print("Do something");
}

Would this work?


Thank you
LazKz
LazKz is offline  
Reply With Quote
Old 05-18-2009, 07:32 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

Hi LazKz, unfortunately not - you would need to program this yourself. For plotting from the strategy you can check this reference sample - http://www.ninjatrader-support2.com/...ead.php?t=6651

To access the unrealized PnL you can work with GetProfitLoss() - http://www.ninjatrader-support.com/H...rofitLoss.html
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 05-18-2009, 07:52 AM   #3
LazKz
Junior Member
 
Join Date: Feb 2009
Posts: 17
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks Bertrand,
I'm afraid you've misunderstood me. My goal is not to create an indicator plot but to access the performance graph values while a strategy is running (live or backtesting). So instead of the unrealized profit Position.GetProfitLoss() I would like to reference the accumulated realized profit and it's value [n] bars ago. The purpose is to see the momentum of the strategy's performance while it is still running. I'm not sure if that is possible.

Thanks
LazKz
LazKz is offline  
Reply With Quote
Old 05-18-2009, 08:03 AM   #4
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

Thanks for clarifying, you could work with the Performance class for this then, this reference sample may help you - http://www.ninjatrader-support2.com/...ead.php?t=4084
NinjaTrader_Bertrand is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Equity Curve indicator evensteven Indicator Development 0 04-26-2009 05:54 PM
Intraday equity curve anapurna Strategy Analyzer 2 03-12-2009 06:24 AM
Curve Fit vs Good Strategy shortorlong Strategy Analyzer 4 05-19-2008 12:02 AM
trading the equity curve ceesvh Strategy Development 3 08-02-2007 03:35 AM
Plotting Strategy Equity Curve on Chart whitmark Strategy Development 1 06-04-2007 05:25 PM


All times are GMT -6. The time now is 03:20 PM.