NinjaTrader Support Forum  
X

Attention!

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


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 07-09-2007, 05:14 AM   #1
whitmark
Certified NinjaScript Consultant
 
Join Date: Nov 2005
Location: Virginia, USA
Posts: 441
Thanks: 0
Thanked 12 times in 7 posts
Send a message via Skype™ to whitmark
Default Standard / Custom Indicator Use within a Strategy

Here is a common usage scenario that arises when I am developing strategies for others that I thought I would share to help those starting out with strategy development . . .

One very nice feature of NinjaScript strategies is the ability to Add() indicators to a chart to help visualize the underlying setup in your trading system. Although technically, the dataseries being plotted is a different than the dataseries used in your entry/exit setup logic, you can be assured that each OnBarUpdate value is the same if each indicator call is driven by the same set of input parameter values. Should you ever have any doubt, you can always Print() the internal values and compare them to the plotted values.

Some indicators you might consider using contain collections of both Lines and Plots. Take the commonly used Stochastics indicator for example. It displays Lines for OB/OS and Plots for %D/%K. Now suppose you would like to use this indicator in a NinjaScript strategy and you want to input parameter values for PeriodD, PeriodK, Smooth, AND OB/OS values. In this context would Add()'ing the standard Stochastics indicator do the trick? No, as the standard indicator does not offer a parameter control the static OB/OS Lines nor can you manipulate the value of Line Collection members directly from the strategy. Also, keep in mind that although you have passed in these OB/OS values as parameters of your strategy, there is no way to Plot() these strategy specific values to the chart . . . . only indicators can Plot() directly to a chart.

In this situation you would be left with two options, 1) create your own custom Stochastics indicator with its unique name, say StochasticsOBOS, that will allow you to pass in the static OB/OS values or 2) use a combination of the standard Stochastics indicator and standard Constant Lines indicator to achieve the same objective within your strategy.

Hope this is helpful. Comments and suggestions from NT Support and other users are most welcome.

Regards,

Whitmark
whitmark 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
Accessing Multiple Custom Indicator Plots within a Strategy whitmark Strategy Development 15 03-28-2009 04:21 PM
Accessing value from custom indicator from strategy funk101 Strategy Development 12 08-19-2008 08:41 AM
Need Help Programming Custom Indicator from TS to NT stevestrading Indicator Development 4 06-20-2007 04:31 PM
Custom Indicator hangs NT on New Strategy Create zoltran Miscellaneous Support 4 06-20-2007 04:30 PM
Using a custom indicator SuzyG Strategy Development 17 03-13-2007 10:59 AM


All times are GMT -6. The time now is 05:06 AM.