24 Commits

Author SHA1 Message Date
Martin Molinero 452bf27bd9 Adding new DataPermissionManager
- Adding new DataPermissionManager that will own the existing
  datachannelProvider. Will assert configurations before added to the
  data feed. Adding unit tests
2020-06-12 12:34:10 -03:00
Stefano Raggi d407307566 Add IObjectStore interface with LocalObjectStore implementation
This commit is squashed from iterative development:

- More consistent method naming
- Storage root path updated to be absolute and include algorithm name
- Storage root path created only if object store is actually used
- Implemented XML save/load
- Added missing unit tests
- Replaced Log.Trace with Log.Error calls
- Added the object store name logging in Engine.Main
- Read storage root from config
- Create algorithm storage root folder in Initialize
- Remove empty folder in Dispose
- Added null checks in all methods
- Added missing XML parameter docs
- make Initialize and Dispose virtual
- make AlgorithmStorageRoot protected

The IObjectStore abstraction provides algorithms with a persistent
storage mechanism. While the algorithm is running, data is maintained
in memory as a dictionary of raw bytes (string -> byte[]). This ensures
we avoid any reference type shenanigans. Periodically, the data in the
object store is persisted and additionally, when the algorithm shuts
down, the object store's data will again be persisted. This ensures that
when the algorithm starts up again, it will have access to any state
that has been saved into the object store.

A great use case for IObjectStore is saving a compute heavy model.
For example, computing the weights of a deep neural network is very
CPU intensive, but after the weights are computed, evaluation is fairly
quick. An initial backtest can be used to solved for the network's weights
and then subsequent backtests or even in live mode, the weights will be
available to the algorithm provided they were saved into the object store.

Also, some libraries require a file path to load model data. The object
store provides a `GetFilePath(key)` method which will copy the data for
the provided key to the disk and return that path so the library can load
the model data.
2019-12-17 22:21:11 -05:00
Jared 992d721d08 Revert "Reduce python load time 30% (#3440)" (#3441)
Reverts test commit 70017f0e05.
2019-07-28 18:37:34 -07:00
Jared 70017f0e05 Reduce python load time 30% (#3440)
Optimize python load times
2019-07-28 17:20:52 -07:00
Michael Handschuh 6b239674e2 Renames Alpha -> Insight
The term 'alpha' is used to describe the entire algorithm. Therefore, 'alpha'
produces insights. From this we have things like IAlphaModel, which is the model
defining how insights are produced. We have IAlphaHandler, which defines how the
insights from a single 'alpha' (the algorithm) are managed, analyzed, and stored.
Types closer to the individual prediction level, such as InsightDirection, or
InsightScore relate directly to exactly 1 insight. The distinction between the
two became more clear as we developed the insights API, and from that effort it
was decided to harmonize alpha/insight terminology across the various QC systems.
2018-03-09 16:12:56 -05:00
Michael Handschuh b4b3aae112 Rename Signal -> Alpha
Whoa... I think I got everything :)
2017-12-15 18:24:58 -05:00
Michael Handschuh 5910bc620f Add ISignalHandler
Handles signals generated by the algorithm. The default implementation
sends a SignalPacket to the messaging handler.
2017-12-12 08:56:19 -05:00
Andrew 719174ebae Added more logging at shutdown 2017-07-29 12:12:38 -04:00
Andrew 6d67dbd2a2 Added ILeanManagement.Update() method 2017-07-14 12:40:53 -04:00
Andrew d57df1abb8 Changed config key name to 'data-provider' 2017-02-17 16:23:46 -05:00
Andrew b6171cc9d5 Renamed IDataFileProvider to IDataProvider using resharper
Refactored IDataProvider interface to return stream. The IDataProvider
Fetch method now only takes a key.  The IDataProvider
has been reshuffled to be at the bottom of the LeanDataStack.  It provides
data to the rest of the Lean stack. The default implementation of IDataProvider reads
data from disc.

All IDataCacheProviders now have constructors which take IDataProviders
and use them to find data on disc.

Renamed DataCacheProvider to ZipDataCacheProvider

Added comments to IDataProvider and it's implementations

Added comments to IDataCacheProvider and it's implementations
2017-02-15 12:16:50 -05:00
quant1729 9dd5b8f4ef Updated engine: it gets history provider, data queue handler from the job now. JobQueue loads data from config. 2016-11-21 16:58:12 +01:00
Andrew fdea52a933 Renamed XxxFileProvider to XxxDataFileProvider 2016-10-20 08:36:36 -04:00
Andrew c0a3285539 Added ApiFileProvider to download data from QC
The ApiFileProvider will attempt to download data not present on the file system from the users QuantConnect data library using the Api
2016-10-17 16:56:44 -04:00
Andrew bcd3cb6b10 FileProvider can now be configured in config.json
The DefaultFileProvider is now configured as by default as the file-provider in config.json and passed in the the engine through the leanAlgorithmHandlers object.

The FileProvider is now passed into the TextSubscriptionDataSourceReader and ZipEntryNameSubscriptionDataSourceReader.  Most of the changes in this commit are just getting the FileProvider to those two methods.
2016-10-17 15:52:11 -04:00
Michael Handschuh cf6b4aa57d Use BacktestingResultHandler instead of ConsoleResultHandler 2016-01-20 14:05:41 -05:00
snugs 5d6d48f7c8 Make ICommandQueueHandler : IDisposable 2015-12-18 11:57:28 -05:00
snugs 7276626c98 Use IFactorFileProvider in SubscriptionDataReader 2015-12-16 17:09:43 -05:00
snugs bb241899fb Implements IMapFileProvider
An IMapFileProvider instance is used to cache/retrieve
MapFileResolver instances for equity symbol resolution
2015-11-16 12:06:15 -05:00
snugs 3285198cfe Implements ICommandQueueHandler
The command queue provides external messaging into the algorithm.
It yields ICommand instances which are runnable against the algorithm.
This allows a user to exercise some control/change over the algorithm's
behavior while it's still running.

To show the pattern, I've implemented the Order, Liquidate, and Quit commands
2015-11-04 21:26:14 -05:00
snugs 65f75708bb Initial implementation of IHistoryProvider 2015-09-15 15:40:09 -04:00
snugs f5d4053815 Exit handlers in Engine.Run, not in dispose 2015-06-23 19:51:45 -04:00
snugs 6f73a23641 Move resolution of algo handlers after NextJob in engine main 2015-06-23 13:52:06 -04:00
snugs 4de2ec4070 Make Engine an instance
Updated all interfaces to accept dependencies via Initialize methods
2015-06-18 13:50:11 -04:00