Commit Graph

978 Commits

Author SHA1 Message Date
snugs e1938baafe Clean up using directives 2015-09-01 22:17:35 -04:00
snugs df79ce30c2 Adds the Symbol type
This includes updating all usages of symbol as a security identifier to use the new type.
The type includes a unique field, SID, as well as the current ticker's value. This allows
for consistent addressability while also allowing the ticker to evolve over time with the
mapping changes.

Effort was made to maintain compile and runtime backwards compatibility.
2015-09-01 22:17:10 -04:00
snugs c5a5ffa8c2 Adds universe selection regression algorithm
Uses the insanely mental GOOG,GOOGL,GOOCV,GOOAV case

Correctly starts with GOOG and adds GOOAV and GOOCV, later we can model the merge of GOOAV->GOOG pre GOOGL
2015-09-01 22:17:08 -04:00
snugs e9ccf2442d Improved the Scheduled events algorithm 2015-08-20 18:45:05 -04:00
snugs 1a8feaeb60 Remove IsTradeBar/HasVolume from API methods 2015-08-12 14:54:17 -04:00
snugs 3317d0b77a Adds OrderTicketDemoAlgorithm 2015-08-12 13:10:23 -04:00
snugs 8380da11cf Adds fluent interface for scheduled events
Algorithms can now use syntax like the following to define events:
Schedule.Event(name).{DateRuleMethod}.{TimeRuleMethod}.Run( lambda )

For example: Schedule.Event(tues).Every(DayOfWeek.Tuesday).AfterMarketOpen(SPY, 20).Run(MyTuesdayHandler);
2015-08-11 10:51:58 -04:00
snugs 730430b1bb Adds scheduling feature
Adds the ScheduleManager which allows an algorithm to add/remove scheduled events
Check out the ScheduledEventsAlgorithm for syntax
ScheduledEvents are at their core an IEnumerator<DateTime> that defines the event times coupled with a callback
IDateRule defines dates for events
ITimeRule defines time(s) on a given date for events
2015-08-10 10:56:14 -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
Ray Bohac 1b9c1b7921 Initial implementation of custom benchmarks 2015-08-05 15:30:34 -04:00
snugs e4404e61fb Adds IBrokerageModel.ApplySplit
Default implementation modifies order prices/quantities to maintain value
Tradier implementation cancels reverse splits and performs the default on forward splits
2015-07-31 17:13:35 -04:00
snugs 2c1a00fa23 Implements Delisting events in the algorithm
This change adds OnData(Delisting data) event handler to the algorithm and is fired when a security gets delisted.
Likewise, when a security is delisted, data will stop being sent into the algorithm and if the algorithm has any
holdings then a MarketOnClose order is submitted at midnight on the last day of trading. If you require that the
algorithm does not sell its shares, then you must cancel the MarketOnClose order before close of trading.
2015-07-29 13:21:25 -04:00
snugs 0d48732546 Misc fixes
Send isLiveMode directly into data readers instead of resolving from data feed endpoint
Added some expression extensions, AsEnumerable()  :)
Fixed Identity names, added optional name parameter for deconflicting
2015-07-09 22:44:12 -04:00
snugs e79e03e28b Check for Filled or PartiallyFilled for order value
When computing order.GetValue(marketPrice) sometimes we want to use the order.Price and other
times we want to use security.Price, we want to use order.Price if the order's status is either
Filled or PartiallyFilled
2015-07-09 20:13:15 -04:00
snugs 76e4ed6836 Use CultureInfo.InvariantCulture in parse routines 2015-07-09 18:50:02 -04:00
snugs 4cc5c1daf7 Use fill price for order value when filled 2015-07-09 18:24:03 -04:00
snugs bd3aaa2155 OBSOLETE Order.Value - Use Order.GetValue(currentMarketPrice) instead 2015-07-09 17:45:50 -04:00
snugs 6bc9c5a7fb Fixes bug related to new time zone feature
RealTimeSynchronizedTimer now triggers based on UTC time
LiveTradingDataFeed used UTC time to add to bridge
Renamed Security.Time to Security.LocalTime to be explicit
Renamed SecurityExchange.Time to SecurityExchange.LocalTime to be explicit
2015-07-09 16:14:19 -04:00
snugs d636b10dca Remove market price as parameter to SubmitOrderRequest 2015-07-09 11:12:18 -04:00
snugs 704bfc2298 Adds new order ticket system
QCAlgorithm order functions now return an OrderTicket

OrderTicket can be used to directly update or cancel an order

Placing an order now submits an OrderRequest which is processed by the ITransactionHandler
2015-07-08 23:40:28 -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
snugs 15542c4efa Adds simple update order algorithm for regression tests 2015-07-06 17:59:42 -04:00
snugs 87554ecf0d Implements OnData(Slice) and remove v1.0 event handlers
Also cleans up IAlgorithm interface of unused/old methods
Slice is a new type that contains all the data from a time slice to be sent into an algorithm
2015-07-03 15:15:15 -04:00
snugs 9c1b0f4616 Move order/order queue storage to transaction handler
Expose order and order processing ability via IOrderProvider/IOrderProcessor
2015-07-02 15:07:35 -04:00
snugs 9b6919e3b5 Adds regression test for limit fills 2015-07-01 21:20:17 -04:00
QuantConnect dd506279b7 Version bump Newtonsoft and MathNumerics, strip unnessary refs 2015-06-29 12:00:46 -04:00
snugs 805ac249e8 Adds a trade heavy regression algorithm 2015-06-24 15:56:10 -04:00
QuantConnect 55a6215da6 Split QCAlgorithm and Algorith,CSharp into separate projects, added FSharp project for algorithms 2015-06-17 17:44:02 -04:00