PDA

View Full Version : Indicator: Manipulating string objects


NinjaTrader_Josh
07-29-2009, 11:38 AM
Reference sample for NinjaTrader 6.5.xxxx.x or greater.

Dealing with strings and other related concepts are essential to many computer programs. This sample is a collection of some of the most common string and text related functions including splitting a string, replacing a string with another string, and a few other string functions.

This reference sample demonstrates the following concepts:
Simple text/string manipulation ideasImportant methods and properties used include:
string.IndexOf() (http://msdn.microsoft.com/en-us/library/aa904283%28VS.71%29.aspx)
string.Replace() (http://msdn.microsoft.com/en-us/library/fk49wtc1.aspx)
string.Split() (http://msdn.microsoft.com/en-us/library/b873y76a.aspx)Other methods and properties of interest include:
ClearOutputWindow() (http://www.ninjatrader-support.com/HelpGuideV6/ClearOutputWindow.html)
Escape characters (http://msdn.microsoft.com/en-us/library/h21280bw.aspx)
Foreach iterator (http://msdn.microsoft.com/en-us/library/ttw7t8t6%28VS.80%29.aspx)
String literals (http://msdn.microsoft.com/en-us/library/aa691090%28VS.71%29.aspx)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 fileNote: A related sample demonstrating how to format numbers can be found here (http://www.ninjatrader-support2.com/vb/showthread.php?t=3823).