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
