Manipulating DateTime objects
An essential element of any trader’s strategies or indicators is time. You may find yourself wanting a high and low marker for a certain timeframe or you might want something drawn on your charts during those choppy lunch hours. DateTime objects are included in the .NET framework, and they can be used to do any time related action, like limiting trading hours or finding the highest high between 9:30AM and 10:30AM.
Key concepts in this example
- Common manipulation of DateTime objects
Important related documentation
- DateTime
- DateTime.Add()
- DateTime.Compare()
- DateTime.Now
- DateTime.TryParse()
- TimeSpan
- DateTime.ToString(string)
- string.Format()
Import instructions
- Download the file contained in this Help Guide topic to your PC desktop.
- From the Control Center window, select the menu Tools > Import > NinjaScript.
- Select the downloaded file.

