Commit Graph

7 Commits

Author SHA1 Message Date
Michael Handschuh ae0919b8e3 Add TimeZoneOffsetProvider.ConvertToUtc
This is really the only use case for this class, converting a local time to UTC properly.
Instead of enforcing this invocation pattern on all consumers, much cleaner to have the
type provide this functionality.
2018-02-13 15:59:55 -05:00
Andrew 85ddda2336 RealTimePrice not set when the exchange is closed
Prevents the subscription.RealtimePrice from being set in the
LiveTradingDataFeed if the exchange is closed. This is accomplished by
tweaking the DataHandler callbacks to check the exchange hours before
setting the real time price.

This change was made so that the LiveTradingDataFeed will respect the
market hours of the security.
2017-03-20 16:54:26 -04:00
snugs 46f9fbf32f Fixes tz bug in file system data feed
Updates affected regression test as well.

It's very important for the data feed to stop on tz disconintuities to ensure we're using the correct utc offset
2015-08-24 22:02:49 -04:00
snugs db9343f88e Fixes bug in TZ offset provider when no discontinuities 2015-08-17 19:27:36 -04:00
snugs 844a040be5 Initial impl of coarse universe selection
Adds concept of Subscription to contain everything a data feed needs in order to process  single data feed item
Moves preparation of all data to data feed thread, algo thread receives data in format it needs
QCAlgorithm.SetUniverse( func ) allows selection based on market/symbol/dollar volume/price
Remove laziness from Slice as optimization, no order by in real time handler
2015-08-06 17:52:23 -04:00
snugs 8c9a69beaf Misc tidy up
Clean up offset provider
Fixes bug in GetBetterTypeName
Adds redelivered flag to log
Fixes bug in Slice.Time
Fire Slice only if data; Fire SecuritiesChanged after update
Add return to margin warning try/catch
2015-08-06 17:52:23 -04:00
snugs 6bd38ece77 Adds international/timezone support
Time sync:
	* Data feeds are required to time sync in UTC time
	* TimeSlice.Time is now in UTC

IAlgorithm
	* Time is now exclusively the algorithm's local time zone
	* Added UtcTime
	* SetDateTime( DateTime ) accepts a UTC time and is internally converted

SubscriptionDataConfig
	* Adds market and time zone as required ctor parameters

SecurityExchange
	* Now passes most calls directly through to SecurityExchangeHours class

SecurityExchangeHours
	* Holds market hours for each day of week (LocalMarketHours)
	* Talks in terms of local times in the SecurityExchangeHours.TimeZone time zone

Data/market-hours/
	* New data folder to hold market hour information
	* Includes market-hours-database.csv to hold market hours per market/symbol/security (see doc in file)
	* Includes holidays-usa.csv to hold holidays for 'usa' market
		+ The holiday files follow the pattern 'holidays-*.csv' where * is the market

TimeKeeper
	* Receives updates in UTC time
	* Passes that to LocalTimeKeeper's who lazily evaluate the time in their respective time zones
	* Eventually this can grow to be the sole source of time in the algorithm's scope

MISC:
	* Fixes exception thrown when exiting LiveTradingDataFeed
	* Fixes exception thrown when exiting FileSystemDataFeed
	* Fixes exception thrown when exiting StatusPing
	* Simplify FillForwardEnumerator logic with GetNextMarketOpen
	* Adds many time zones, see TimeZones.cs
2015-07-08 18:45:34 -04:00