![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Tips Official NinjaScript tips and tricks |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
When backtesting strategies it can be useful to add the indicators you use for calculations onto the chart to make it easier to check your strategy for accuracy. Instead of doing this step manually every time you run the strategy you can program it to automatically load the indicators for you.
For example: To add a volume indicator to your charts you need to add this code snippet into the Initialize() section of your code. Code:
Add(VOL()); Code:
VOLMA(20).Panel = 2; Add(VOLMA(20)); Code:
EMA(13).Plots[0].Pen.Color = Color.Blue; // Plots the EMA as a blue line Code:
EMA(13).Plots[0].Pen.Width = 2; // Plots the EMA line with a width of 2 Code:
RegressionChannel(60, 2).Plots[0].Pen.DashStyle = DashStyle.Dash; Code:
RSI(14, 3).Lines[0].Value = 20; RSI(14, 3).Lines[0].Pen.Color = Color.Green;
Josh
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| NinjaScript Strategies vs Indicators | whitmark | General Programming | 7 | 08-29-2007 02:55 PM |
| Adding Strategies via Charts | NinjaTrader_Josh | Charting | 1 | 07-28-2007 11:03 PM |
| Adding Indicators | NinjaTrader_Josh | General Programming | 12 | 05-24-2007 12:23 PM |
| Missing strategies, indicators, templates | BradB | Installation and Licensing | 2 | 02-12-2007 02:26 AM |
| adding indicators to charts | traderkd | Charting | 2 | 01-24-2006 08:01 AM |