Get()

<< Click to Display Table of Contents >>

Navigation:  NinjaScript > Language Reference > Common > TradingHours >

Get()

Previous page Return to chapter overview Next page

Definition

Returns the TradingHours object for the specified Trading Hours template name, such as "CME US Index Futures RTH"
 

Method Return Value

A TradingHours object representing the specified Trading Hours template name.

 

Syntax

Get(string name)

 

Parameters

name

The name of the desired TradingHours object to return

 

 

Examples

ns

// Loop through and print all regular holidays in the found TradingHours object
foreach(KeyValuePair<DateTime, string> holiday in TradingHours.Get("CME US Index Futures RTH").Holidays)
{
  Print(String.Format("Date: {0} Description: {1}", holiday.Key, holiday.Value));
}