NinjaScript > Educational Resources > Reference Samples > Strategy >

Plotting from within a NinjaScript Strategy

Print this Topic Previous pageReturn to chapter overviewNext page

When running a strategy on a chart you may find the need to plot values onto a chart. If these values are internal strategy calculations that are difficult to migrate to an indicator, you can use the following technique to achieve a plot.

 

The technique involves the use of a custom indicator, StrategyPlot(), that is included in the import.

 

Note

This technique has limited functionality. It will NOT work for charts in the Strategy Analyzer during backtesting, but it will work on real-time charts.

 

Key concepts in this example:

Set values to a blank indicator from a strategy
Plot multi-time/instrument values
Value.Set()
Pen.Width
Pen.DashStyle

 

Important related documentation

AddPlot()

 

Import instructions

1.Download the file contained in this Help Guide topic to your PC desktop
2.From the Control Center window, select the menu File > Utilities > Import NinjaScript
3.Select the downloaded file and click Import.

 

SampleStrategyPlot_NT7.zip