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 > Application Technical Support > Strategy Analyzer

Strategy Analyzer Support for automated system backtesting and optimization using the NinjaTrader Strategy Analyzer.

Reply
 
Thread Tools Display Modes
Old 07-27-2010, 09:55 AM   #1
8DTK8
Senior Member
 
Join Date: Jun 2008
Posts: 168
Thanks: 0
Thanked 0 times in 0 posts
Default script to have indicators already on "chart" tab in strategy analyzer

Sounded simple enough, but it's hard to search for "indicator and strategy and analyzer" in this forum.

Is there any way to have certain indicators already on the "chart" tab in strategy analyzer once the backtest has been run? For example, if the strategy involves volume, a 5 min SMA and a 15 min SMA, one would probably want to see all of those things when reviewing the chart without having to add each one after the test has run.

I know that it can be done with the drawing tools within the script, but this seems CPU intensive. I tried loading a template afterwards, but it removed all of my buy and sell points.

Many thanks in advance.
8DTK8 is offline  
Reply With Quote
Old 07-27-2010, 10:14 AM   #2
NinjaTrader_Brett
NinjaTrader Customer Service
 
NinjaTrader_Brett's Avatar
 
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
Default

Hello,

Thank you for your forum post.

You can add these with your strategy. To do this use the Add() method in the Initilize() Method.

Please see the following:

http://www.ninjatrader-support.com/H...deV6/Add1.html

Code:
protected override void Initialize() 
{ 
    // Add a 5 minute Bars object - BarsInProgress index = 1 
    Add(PeriodType.Minute, 5);
    // Add a 100 tick Bars object for the ES 12-06 contract - BarsInProgress index = 2 
Add("ES 12-06", PeriodType.Tick, 100); 
                                     
    // Charts a 20 period simple moving average to the chart 
Add(SMA(20));  
}
NinjaTrader_Brett is offline  
Reply With Quote
Old 07-27-2010, 05:09 PM   #3
8DTK8
Senior Member
 
Join Date: Jun 2008
Posts: 168
Thanks: 0
Thanked 0 times in 0 posts
Default

Thank you.

I have successfully added the SMA this way, but can not figure out how to get volume in the chart. Everything that I have tried will not compile. I would like to see it just in zone 2 like an ordinary graph.

Also, is there any way to use Add() for custom indicators?

Thank you again,

DK
8DTK8 is offline  
Reply With Quote
Old 07-28-2010, 08:17 AM   #4
NinjaTrader_Brett
NinjaTrader Customer Service
 
NinjaTrader_Brett's Avatar
 
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
Default

Hello,

You would use Add(VOL()); should do the trick.

You would only be able to add this for strategies and you will get an error if you try to add it to an indicator.

Let me know if I can be of further assistance.
NinjaTrader_Brett is offline  
Reply With Quote
Old 07-28-2010, 08:53 AM   #5
8DTK8
Senior Member
 
Join Date: Jun 2008
Posts: 168
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks Brett,

Is there any way to pass on details such as where you would want a particular indicator? For example, with your help I was able to get volume on the chart as well as VolSMA(20). But volume is on panel 2 and VolSMA(20) is on panel 3. I would like it to be overlayed on panel 2.

Similarly, I have a custom indicator that is supposed to be overlaid on price, but instead it is displayed in a panel below.

Continuing to appreciate your help,
D
8DTK8 is offline  
Reply With Quote
Old 07-28-2010, 09:41 AM   #6
NinjaTrader_Brett
NinjaTrader Customer Service
 
NinjaTrader_Brett's Avatar
 
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
Default

Hello,

You cannot predetermine what panel an indicator is going to reside on besides the price panel. If you want it on the price panel you will have to type in Overlay = true. Otherwise each new indicator will by default be added to a new panel.

http://www.ninjatrader.com/support/h...t7/overlay.htm

Let me know if I can be of further assistance.
NinjaTrader_Brett 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
NT& B13 - Indicators Added in Strategy "overwrite" existing inds in Chart Panels dnoff Version 7 Beta General Questions & Bug Reports 3 04-01-2010 04:02 PM
Where is "Text and Marker" for Strategy Analyzer chart? LG Version 7 Beta General Questions & Bug Reports 7 02-01-2010 09:58 AM
summary of "strategy realized" is not equal "account performance, total net profit"" Fragolino Miscellaneous Support 1 02-19-2009 04:12 AM
How to "Rename" or "Save As" a unlocked Ninja Script robhef General Programming 2 09-11-2008 10:38 AM
Control center "strategies" tab, "Positions tab, and "Market Analyzer" not funk101 Strategy Development 6 04-10-2007 03:44 AM


All times are GMT -6. The time now is 08:22 PM.