NinjaTrader_Josh
12-30-2007, 07:49 PM
Reference sample for NinjaTrader 6.5.XXXX.X or greater.
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.
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.
This reference sample demonstrates the following concept:
Overriding the ToString() method
Important methods and properties used include:
ToString()
DrawTextFixed() (http://www.ninjatrader.com/support/helpGuides/nt7/drawtextfixed.htm)
Other methods and properties of interest include:
DrawText() (http://www.ninjatrader.com/support/helpGuides/nt7/drawtext.htm)
Import instructions for NinjaTrader 6.5.XXXX.X or greater:
Download the file contained in this thread to your PC desktop
From the Control Center window, select the menu File > Utilities > Import NinjaScript
Select the downloaded file
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.
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.
This reference sample demonstrates the following concept:
Overriding the ToString() method
Important methods and properties used include:
ToString()
DrawTextFixed() (http://www.ninjatrader.com/support/helpGuides/nt7/drawtextfixed.htm)
Other methods and properties of interest include:
DrawText() (http://www.ninjatrader.com/support/helpGuides/nt7/drawtext.htm)
Import instructions for NinjaTrader 6.5.XXXX.X or greater:
Download the file contained in this thread to your PC desktop
From the Control Center window, select the menu File > Utilities > Import NinjaScript
Select the downloaded file