Lean  $LEAN_TAG$
QuantConnect.Lean.Engine.DataFeeds.ManualTimeProvider Class Reference

Provides an implementation of ITimeProvider that can be manually advanced through time More...

Inheritance diagram for QuantConnect.Lean.Engine.DataFeeds.ManualTimeProvider:
[legend]

Public Member Functions

 ManualTimeProvider (DateTimeZone setCurrentTimeTimeZone=null)
 Initializes a new instance of the ManualTimeProvider More...
 
 ManualTimeProvider (DateTime currentTime, DateTimeZone setCurrentTimeTimeZone=null)
 Initializes a new instance of the ManualTimeProvider class More...
 
DateTime GetUtcNow ()
 Gets the current time in UTC More...
 
void SetCurrentTimeUtc (DateTime time)
 Sets the current time interpreting the specified time as a UTC time More...
 
void SetCurrentTime (DateTime time)
 Sets the current time interpeting the specified time as a local time using the time zone used at instatiation. More...
 
void Advance (TimeSpan span)
 Advances the current time by the specified span More...
 
void AdvanceSeconds (double seconds)
 Advances the current time by the specified number of seconds More...
 

Detailed Description

Provides an implementation of ITimeProvider that can be manually advanced through time

Definition at line 27 of file ManualTimeProvider.cs.

Constructor & Destructor Documentation

◆ ManualTimeProvider() [1/2]

QuantConnect.Lean.Engine.DataFeeds.ManualTimeProvider.ManualTimeProvider ( DateTimeZone  setCurrentTimeTimeZone = null)

Initializes a new instance of the ManualTimeProvider

Parameters
setCurrentTimeTimeZoneSpecify to use this time zone when calling SetCurrentTime, leave null for the default of TimeZones.Utc

Definition at line 37 of file ManualTimeProvider.cs.

◆ ManualTimeProvider() [2/2]

QuantConnect.Lean.Engine.DataFeeds.ManualTimeProvider.ManualTimeProvider ( DateTime  currentTime,
DateTimeZone  setCurrentTimeTimeZone = null 
)

Initializes a new instance of the ManualTimeProvider class

Parameters
currentTimeThe current time in the specified time zone, if the time zone is null then the time is interpreted as being in TimeZones.Utc
setCurrentTimeTimeZoneSpecify to use this time zone when calling SetCurrentTime, leave null for the default of TimeZones.Utc

Definition at line 49 of file ManualTimeProvider.cs.

Member Function Documentation

◆ GetUtcNow()

DateTime QuantConnect.Lean.Engine.DataFeeds.ManualTimeProvider.GetUtcNow ( )

Gets the current time in UTC

Returns
The current time in UTC

Implements QuantConnect.ITimeProvider.

Definition at line 59 of file ManualTimeProvider.cs.

Here is the caller graph for this function:

◆ SetCurrentTimeUtc()

void QuantConnect.Lean.Engine.DataFeeds.ManualTimeProvider.SetCurrentTimeUtc ( DateTime  time)

Sets the current time interpreting the specified time as a UTC time

Parameters
timeThe current time in UTC

Definition at line 68 of file ManualTimeProvider.cs.

Here is the caller graph for this function:

◆ SetCurrentTime()

void QuantConnect.Lean.Engine.DataFeeds.ManualTimeProvider.SetCurrentTime ( DateTime  time)

Sets the current time interpeting the specified time as a local time using the time zone used at instatiation.

Parameters
timeThe local time to set the current time time, will be converted into UTC

Definition at line 79 of file ManualTimeProvider.cs.

Here is the call graph for this function:

◆ Advance()

void QuantConnect.Lean.Engine.DataFeeds.ManualTimeProvider.Advance ( TimeSpan  span)

Advances the current time by the specified span

Parameters
spanThe amount of time to advance the current time by

Definition at line 88 of file ManualTimeProvider.cs.

Here is the caller graph for this function:

◆ AdvanceSeconds()

void QuantConnect.Lean.Engine.DataFeeds.ManualTimeProvider.AdvanceSeconds ( double  seconds)

Advances the current time by the specified number of seconds

Parameters
secondsThe number of seconds to advance the current time by

Definition at line 97 of file ManualTimeProvider.cs.

Here is the call graph for this function:

The documentation for this class was generated from the following file: