![]() |
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
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Junior Member
Join Date: Feb 2009
Posts: 17
Thanks: 0
Thanked 0 times in 0 posts
|
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 |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
|
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
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Feb 2009
Posts: 17
Thanks: 0
Thanked 0 times in 0 posts
|
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 |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
|
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
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |