MarketInfo Class

The MarketInfo class represents a single market, including its open and closing times, the time zone it trades in, and its holidays and days that have special open and close times.

BuyAtMarket

CloseTimeNative Property

DateTime CloseTimeNative

Return the time that the market typically closes, in its native time zone.

Example (see SpecialHours)

BuyAtMarket

Description Property

string Description

Return a brief description of the market.

BuyAtMarket

Holidays Property

List<DateTime> Holidays

Return a list of DateTime objects that represent the market's holidays; days that it does not trade.


Example

protected override void Execute(){
char tab = '\t';
            PrintDebug( "Total Holiday count: "+ Bars.MarketInfo.Holidays.Count );
            PrintDebug( "------------------------" );
            PrintDebug( "Date" + tab + "Market Name" );
            foreach (DateTime dt in Bars.MarketInfo.Holidays)
                PrintDebug( dt.ToShortDateString() + tab + Bars.MarketInfo.Name.ToString() );

        }
    }
}
BuyAtMarket

Name Property

string Name

Return the name of the market.

BuyAtMarket

OpenTimeNative Property

DateTime OpenTimeNative

Return the standard time that the market opens for trading, in its native time zone.

Example (see SpecialHours)

BuyAtMarket

SpecialHours Property

List<MarketSpecialHours> SpecialHours

Return a list of MarketSpecialHours objects that represent days where the market has special trading hours. The MarketSpecialHours class contains only three properties, all DateTimes: Date, OpenTimeNative, and CloseTimeNative.


Example

protected override void Execute(){
char tab = '\t';
            PrintDebug( "Total Shortened Session count: "+ Bars.MarketInfo.SpecialHours.Count );
            PrintDebug( "------------------------" );
            PrintDebug( "Date" + tab + tab + "Open" + tab + "Close" + tab + "Market Name" );
            foreach (MarketSpecialHours sh in Bars.MarketInfo.SpecialHours)
                PrintDebug( sh.Date.ToShortDateString() + tab + sh.OpenTimeNative.ToString("t") + tab + 
                    sh.CloseTimeNative.ToString("t") + tab + Bars.MarketInfo.Name.ToString() );

        }
    }
}
BuyAtMarket

TimeZoneName Property

string TimeZoneName

Return the Windows string representing the time zone that the market trades in. For example, for EST, return "Eastern Standard Time".