Commit Graph

19 Commits

Author SHA1 Message Date
AlexCatarino 672cea86a6 Adds QCAlgorithm.WarmUpIndicator Method
This helper method can be used to warm up indicators individually whether it is created after the security has been added to the universe or before (universe selection scenario).

- Fix the subscription addition to `SubcriptionManager` when a History request is made before the security is created, since it should be not added.

- `IndicatorBase.Update` does not throw when an input is older than the last update. We only log (adds QuantConnect.Logging dependency to QuantConnect.Indicators) the error and discard the addition. Removes unit test for that exception.
2019-04-18 23:28:48 +01:00
Martin Molinero ff2a262c22 Fix IndicatorBase.Equals()
- Adding `try catch` statement in the `IndicatorBase.Equals()` method
when converting `obj` to `decimal`.
2019-02-26 13:59:30 -03:00
Martin Molinero 52d80e74f0 Indicator extensions support all indicator types 2018-08-14 18:14:46 -03:00
AlexCatarino 508ac4798a Uses IndicatorDataPoint constructor instead of Activator
Invoking the `Activator` is costly. Instead, we use the `IndicatorDataPoint` constructor and cast it to `object` then to `T`, since it requires less CPU time than invoking the reflection libraries.
2017-10-13 19:10:38 +01:00
AlexCatarino 224c8698fc Refactors indicator Update(DateTime, decimal) method
Moves indicator Update(DateTime, decimal) method overload from the extension class to the base class.
With this change, python algorithms can access this overload since pythonnet doesn't support extension methods.
2017-10-13 19:10:38 +01:00
Michael Handschuh 591f6b2127 Use IBaseData in type constraints
Refactors existing consolidators, indicators, and helper methods to depend on
IBaseData instead of BaseData. These updates also defines an IBaseDataBar to
act as an abstraction point between TradeBar and QuoteBar.
2016-11-09 09:20:16 -05:00
Michael Handschuh b0ca9a7edd Extract IIndicator<T> interface from IndicatorBase<T> 2016-04-05 19:35:06 -04:00
Michael Handschuh d5ee376a6d Move IndicatorUpdateHandler to Common/Indicators 2016-04-05 19:26:54 -04:00
Stefano Raggi f35e7f9dbe Adds IndicatorBase<T>.ValidateAndComputeNextValue
Closes @292
2016-02-17 19:15:46 -05:00
Michael Handschuh ec5ad3dadf Add indicator operator overloads
Comparison operators for double, float, int and long
2016-02-09 16:27:02 -05:00
snugs 39e33db41f Reset _previousValue in IndicatorBase 2015-09-15 15:40:08 -04:00
snugs e1938baafe Clean up using directives 2015-09-01 22:17:35 -04:00
snugs 759273565b misc fixes 2015-06-08 10:51:06 -04:00
snugs 41cccea0d9 Make indicators IComparable 2015-05-21 21:10:17 -04:00
QuantConnect 8bb2673ba1 Added more information to forward only indicator error 2015-03-12 13:12:25 -05:00
snugs cf3a399799 Updates CompositeIndicator to use push system
Removed IDataConsolidator from IndicatorBase
Renamed IndicatorBase.DataConsolidated -> Updated
ConstantIndicator is now sealed
IndicatorBase.Current is now protected set to allow ConstantIndicator to set it upon construction
CompositeIndicator wires up events on left/right to auto update himself following Updated events from both left/right (unless one is constant, this will not work with two constant indicators as left/right)
2015-03-01 13:26:26 -05:00
snugs 374c8c17af Removes SequentialIndicator and uses events for auto push
IndicatorBase now implements IDataConsolidated and fires the DataConsolidated event after each update.
The Of extension method now attaches a handler to the 'first' to update the 'second' and returns the reference to the 'second' for method chaining. See OfExtensionMethodTests.cs
2015-02-28 23:41:02 -05:00
Michael Ourednik 80b1caf327 BollingerBands indicator 2015-02-01 10:50:52 +13:00
Jared Broad b3de520915 Initial commit 2015-01-12 12:03:33 -03:00