NinjaScript > Educational Resources > Reference Samples > Indicator >

Manipulating DateTime objects

Print this Topic Previous pageReturn to chapter overviewNext page

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

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.

 

SampleDateTimeFunctions_NT7.zip