Commit Graph

861 Commits

Author SHA1 Message Date
snugs 32d81af072 Change coarse selector to return symbol
This is less restrictive and the engine really doesn't need the
actual coarse data, just needs to know what symbols to request
data for
2015-10-01 13:44:27 -04:00
snugs d7520d2a6a Remove explicitly implemented IAlgorithm members
It seems the IronPython engine had a hard time resolving explicit interface
implementations, so we'll just remove the explcitness. It was originally provided
to coax algorithm writers to not directly use the provider due to its API.
2015-09-28 15:07:16 -04:00
snugs f3f27d8403 Prevent future history requests 2015-09-23 21:21:08 -04:00
snugs 6bf9cc0f2a Fix duplicate tz application in History API impls 2015-09-23 20:26:22 -04:00
snugs 57f223d2b0 Adds missing History API method 2015-09-23 20:12:01 -04:00
snugs fbc6c4e4f2 Moved History and warmup API methods into QCAlgorithm.History.cs 2015-09-23 19:11:49 -04:00
snugs bf4a6e731a Remove duplicate in History API implementations 2015-09-23 19:11:48 -04:00
snugs 950c2968bd Remove commented out old history API 2015-09-23 19:11:48 -04:00
snugs 96f20443f5 Fixes bug not adding benchmark security 2015-09-23 14:06:07 -04:00
snugs d4f8006443 Revert "Enforce a 100k bar limit on warmup requests"
This reverts commit 5d30dedb46.

*This check was removed from lean as it is a cloud only concern.
2015-09-22 21:15:08 -04:00
snugs 5d30dedb46 Enforce a 100k bar limit on warmup requests 2015-09-22 20:17:44 -04:00
snugs 19f2fbe0ec Fixes bug in timespan warmup
Better status messaging when finished warmup as well
2015-09-22 19:28:07 -04:00
snugs 089d12b190 Fixes bug running warmup over timespan in live mode 2015-09-22 19:07:15 -04:00
snugs 63ceefc4ed Initial implementation of algorithm warmup 2015-09-22 15:14:46 -04:00
snugs d2c431913f Make one second minimum in bar count calcs 2015-09-22 15:14:41 -04:00
snugs a6c4a8dd22 Doc fix, also moved func next to other similar funcs 2015-09-22 15:14:41 -04:00
snugs c67ff638f4 Renames Symbol.SID to Symbol.Permtick
Coming soon we'll have a full SID system, so renames to make backwards compatibility easier
2015-09-20 23:14:53 -04:00
snugs f30259a08c Properly set algorithm.UtcTime for usage in Initialize 2015-09-20 21:21:50 -04:00
Stefano Raggi fac6f46a9a New Statistics implementation
Added Trade and TradeBuilder classes
Added UtcTime and OrderFee property to OrderEvent class
Added AlgorithmPerformance class with a few metrics + tests
Added portfolio statistics + rolling statistics

Closes #30 via PR #164

Thanks @SteffanoRaggi!
2015-09-16 20:48:02 -04:00
roei 788b598b6d Parabolic SAR indicator
Added new PSAR indicator and associated helper method and test.
The PSAR implementation is based on the TA-Lib project implementation.
Included test use the provided spy_parabolic_SAR.txt data.

PR #165
2015-09-16 11:41:05 -04:00
snugs 4ae1f4f5b6 Finalizes History API
Fixes bug in backtest history provider

	Requests for bar counts were always incorrect because the history provider
	was emitting bars whose end time is equal to the start time.
	Implemented a FilterEnumerator<T> privately so he can filter those out
	when using non-tick data
2015-09-15 15:40:54 -04:00
snugs 5b29b8f230 Update IHistoryProvider to use request object 2015-09-15 15:40:52 -04:00
snugs 3ad5540a8a Remove dependency on Security from SubscriptionDataReader
Add dynamic data flag to config
Remove dynamic data flag from Security
Rename dynamically loaded flag to IsCustomData
Remove Security from SubscriptionDataReader ctor
2015-09-15 15:40:12 -04:00
snugs 65f75708bb Initial implementation of IHistoryProvider 2015-09-15 15:40:09 -04:00
lockyssmith b79431a8c9 Creates the Keltner Channel indicators with KCH short code 2015-09-14 16:44:24 -04:00
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
Michael f42f1f47d9 Merge pull request #155 from chutes/master
Creates log return indicator and tests

Closes #154 - thanks @chutes
2015-08-27 09:52:43 -04:00
snugs 4bc2092d8c Adds OnData(SymbolChangedEvents) handler 2015-08-25 21:22:43 -04:00
snugs ed957a74a7 Produce symbol changed events 2015-08-25 21:22:42 -04:00
Mitchell Suzuki f4a016d679 created log return indicator and tests 2015-08-25 16:23:03 -04:00
Michael b0287b529c Merge pull request #151 from adriantorrie/issue-150/asymmetric-donchian-channel
Add DonchianChannel constructor overload

Thanks @adriantorrie for the great contribution!
2015-08-19 17:30:48 -04:00
Adrian Torrie 121aa55664 Add overload helper method in QCAlgorithm for DonchianChannel indicator 2015-08-18 21:21:38 +10:00
snugs 12c432735f Allow setting of custom data TimeZone 2015-08-12 16:04:36 -04:00
snugs 5de2d80424 Add generic type constraints to AddData<T> 2015-08-12 15:47:32 -04:00
snugs 1a8feaeb60 Remove IsTradeBar/HasVolume from API methods 2015-08-12 14:54:17 -04:00
snugs 9502138167 Simplify DynamicDataConsolidator constructors/impl 2015-08-12 14:36:20 -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 b68a8be848 Move Date and Time rules to ScheduleManager 2015-08-10 11:38:48 -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
snugs e16c82a856 Adds IAlgorithm.PostInitialize
Resolve benchmark in PostInitialize method
2015-08-06 13:05:05 -04:00
QuantConnect 06b493902c Merge branch 'master' of https://github.com/QuantConnect/Lean 2015-08-05 18:10:11 -04:00
QuantConnect 770d89e532 Tweak CalculateOrderQuantity to use same price variable for error detection and math 2015-08-05 18:09:43 -04:00
Ray Bohac 1b9c1b7921 Initial implementation of custom benchmarks 2015-08-05 15:30:34 -04:00
snugs 7dc00cb2f8 Add Identity overload for TimeSpan 2015-08-01 13:30:45 -04:00
snugs 9658bedc59 Overload RegisterIndicator to take TimeSpan 2015-08-01 13:06:45 -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 0a74f6fe24 Fixes bug in order time stamps
This also resolves an issue of filling daily orders on open of same bar
2015-07-27 18:52:32 -04:00
Michael 0a43624549 Adds check for data in CalculateOrderQuantity
Adds check to verify we have data for the security
2015-07-27 13:09:45 -04:00