Manipulating DateTime objects

<< Click to Display Table of Contents >>

Navigation:  NinjaScript > Educational Resources > Reference Samples > Indicator >

Manipulating DateTime objects

Previous page Return to chapter overview Next 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 Tools > Import > NinjaScript
3.Select the downloaded file

 

SampleDateTimeFunctions_NT8.zip