NinjaScript > Educational Resources > Reference Samples > Indicator >

Removing and Custom Formatting an Indicator’s Chart Label

Print this Topic Previous pageReturn to chapter overviewNext page

If you create a NinjaScript indicator or strategy with many customizable parameters, you will have a long label when you load the NinjaScript onto your chart. This may be visually cumbersome so you may want to trim the displayed label to a more manageable size that only contains the most important parameters.

 

Key concepts in this example

Creating a custom string for the label of the NinjaScript item.

 

Important related documentation

DrawTextFixed()
DrawText()
Overriding the ToString() method
ToString()

 

TIP

When adding an indicator onto a chart you can also completely remove any labeling on the chart of the indicator name. You can do this by clearing the “Label” field under the “General” category when you add the indicator onto the chart.

 

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.

 

SampleLabelTrim_NT7.zip