Commit Graph

139 Commits

Author SHA1 Message Date
AlexCatarino d7d749a000 Adds Missing Logic That Enables Automatic Indicator WarmUp 2019-06-25 21:09:49 +01:00
Jack Simonson af883366d8 Fix MACD Indicator Naming 2019-06-04 12:14:49 -07:00
AlexCatarino 95faf69c72 Addresses Peer-Review
- Consistently use QuantConnect/Lean naming convention for method variables;
- Use `IND(PARAM1,PARAM2, ..., PARAMN)` format for indicators. Indicators that are created by a helper method become: `IND(PARAM1,PARAM2, ..., PARAMN, SYMBOL_res)`.
- Fixes `RegressionChannelTest`.
2019-05-14 21:52:10 +01:00
AlexCatarino 0b0e6de198 Indicators with name starting with H to M.
- Since `MomentumPercent` derives from `RateOfChangePercent`, the `RateOfChange` family was included in this commit.
2019-05-14 13:32:47 +01:00
AlexCatarino c7be510e7a Implements IIndicatorWarmUpPeriodProvider in IchimokuKinkoHyo
- Implements `IIndicatorWarmUpPeriodProvider`;
- Refactors `IchimokuKinkoHyo`;
- Fixes sub-indicator computations: the `Delay` sub-indicators were accepting input from indicators that were not realy;
- Adds `Chikou` indicator (closes #919);
2019-05-13 21:28:19 +01:00
AlexCatarino 3323b7b86d Fixes FishTransform Indicator
- The `FisherTransformFunction` was rounding up(down) the input value instead of down(up).
- Adds the `FISH` method to QCAlgorithm.
2019-05-13 17:57:08 +01:00
AlexCatarino 1be9482728 Indicators with name starting with B to F. 2019-05-13 17:50:51 +01:00
AlexCatarino a2f25ffa31 Extends a Series of Indicators With IIndicatorWarmUpPeriodProvider
- Indicators with name starting with A;
- `Maximum`. `Minimum` and `MACD`;
- Adds new unit test method to `CommonIndicatorTests`: `WarmsUpProperly`;
- Indicators unit tests inherit from `CommonIndicatorTests`.
2019-05-10 20:04:55 +01:00
AlexCatarino 04a529c758 Addresses Review
- Removes `UniverseSettings.DataNormalizationMode` (it will ne addressed in a dedicated issue: https://github.com/QuantConnect/Lean/issues/3082)
- Adds examples/tests for Tick resolution, Forex (QuoteBar data) and Custom data.
  - Tick resolution is not allowed: logs a message
  - Custom data example/test added in `CustomDataNiftyAlgorithm`
- Adds support for ATR and VWAP since they are, respectively, a bar and a trade bar indicator.
- Adds consolidators to handle difference between data resolution and indicator resolution.
2019-04-18 23:29:51 +01:00
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
AlexCatarino 0202df35f4 Replaces Enum CalendarType for Static Class with the Same Name
Replaces Enum `CalendarType` for static class with the same name. This class defines two properties (`Weekly` and `Monthly`) that can be used to define the previous calendar date (Monday or 1st of current month) which will correspont to the `Time` of a `IBaseData` object.

Refactor `PeriodCountConsolidatorBase` to define use `GetRoundedBarTime` based on a period specification that depends on the constructor overload: `integer`, `TimeSpan` or `Func<DateTime, CalendarInfo>`. The last one can be set with the `CalendarType` properties.
2019-04-08 22:10:04 +01:00
AlexCatarino 5314e7426d Implements Calendar (Weekly/Monthly) Consolidator
Implements consolidators that group bars by a calendar unit (week or month).
2019-04-08 22:10:04 +01:00
Michael Handschuh f93704fbe0 Change RSI indicator helper to default to Wilders moving average 2018-07-06 06:08:04 -04:00
Stefano Raggi 535d8568c5 Fix non-deterministic query in QCAlgorithm.GetSubscription 2018-06-15 17:36:44 +02:00
Michael Handschuh bb21171943 Implements python Consolidate API
Collapse QuoteBar to TradeBar if trade bar handler specified
2018-06-12 13:17:49 -04:00
Michael Handschuh 007bcea6b8 Add Consolidate API
These new methods allow algorithms to quickly create, register, and
wire events on consolidators in a single line.
2018-06-12 12:58:28 -04:00
Michael Handschuh 0df11e91dc Add obsolete warning message for RSI short hand
The default moving average type for RSI should be wilder's avg.
We'll change the default value in about a month or so.
2018-04-30 16:22:45 -04:00
Michael Handschuh 92c5e64024 Adds VWAP and STD execution models
VWAP will submit market orders while the current price is more favorable than VWAP.
STD will submit market orders while the current price is a configured number of
standard deviations away from the mean in the favorable direction.
2018-04-06 16:30:26 -04:00
Michael Handschuh 81f8fbfb85 Add IntradayVwap indicator w/ VWAP(symbol) helper
This is the traditional VWAP indicator that resets each day at market open.
2018-04-06 16:27:14 -04:00
Juan José D'Ambrosio e475385146 remove obsolte property, make EMA default
Update HistoryAndWarmupRegressionAlgorithm
2018-04-03 17:35:10 -03:00
AlexCatarino 03876a0b30 Adds method helper WWMA
WWMA method helper creates a `WilderMovingAverage` indicator that will be automatically updated on the given resolution.
2018-03-21 09:49:19 +00:00
Juan José D'Ambrosio e38b520383 MACD default MovingAverageType
this RP only adds the Obsolete property to the constructor and `MACD` method in the `QCAlgorithm.Indicators.cs` file
2018-02-05 18:11:10 -03:00
Juan José D'Ambrosio e7223da4a7 Coppock Curve indicator implementation 2018-01-30 12:05:13 -03:00
jjd df0714f5e2 Michael reviews. 2017-10-12 17:50:17 -03:00
jjd 354da79c04 DetrendedPriceOscillator indicator.
Small redudant code fix at CompositeIndicator.cs
2017-10-11 09:56:57 -03:00
Jared 57fa355fc0 Merge pull request #1109 from Jay-Jay-D/IndicatorMassIndex
Indicator mass index
2017-09-06 16:38:38 -04:00
jjd 215224de2f helper method renamed MI->MASS 2017-09-01 15:23:11 -03:00
jjd d8b2a1a63b Test passed 2017-09-01 14:40:26 -03:00
jjd 21a7685e64 helper method added. 2017-08-29 15:48:08 -03:00
AnshulYADAV, Computer Artist (CoArsey) 350e58567f Fixes 18 warnings with code CS1572 (#908)
* Fixes 5 warnings with code CD1572

* Adds the Xml Comment parameter and implements the missing selector parameter

* Fixes rest of the 13 warnings with code CS1572
2017-05-12 09:28:46 -04:00
Juan José D'Ambrosio b9c5557ea6 ALMA sigma parameter default value (#890)
* Update the ALMA using the correct default value for sigma

* makes ALMA default sigma = 6

* Incorporate the statistical interpretation of the parameters in the docstring.

* documentation small fixes.
2017-05-08 09:17:10 -04:00
jjd fae8e681e8 Helper method added.
Indicators helper method sorted alphabetically.
2017-05-02 12:14:49 -03:00
jjd 26b1f5de90 Helper method renamed from HULL to HMA.
Hull value added in the MovingAverageType enumeration.
MovingAverageTypeExtensionsTests added.
2017-04-28 08:47:11 -03:00
jjd c37282d522 HullMovingAverage, tests and helper method implemented 2017-04-27 20:52:27 -03:00
AlexCatarino 0f46f34418 Implements FilteredIdentity indicator
Represents an indicator that is a ready after ingesting a single sample and always returns the same value as it is given if it passes a filter condition
Adds an example algorithm
2017-03-06 14:40:14 -03:00
AlexCatarino 70735cea12 Fixes API indicators with quote subscriptions
When indicators received data from securities that were subscribed as QuoteBar or TickType.Quote, they were consolidated as TradeBars.
Tick were consolidated into TradeBar even when period were zero. Tick object information was lost in the process. With this fix, Tick keeps being Tick.

Adds tests for ResolveConsolidator to verify the consistency between input and output type
TradeBar -> TradeBar
QuoteBar -> QuoteBar
TickType.Trade -> TickType.Trade or TradeBar
TickType.Quote -> TickType.Quote or TradeBar
2017-03-06 10:22:27 -03:00
Stefano Raggi 8b946a8fd1 Add Volume property to HeikinAshi indicator
This makes volume available to indicators chained to HeikinAshi, as requested here:
https://www.quantconnect.com/forum/discussion/1566/getting-volume-in-a-heikin-ashi-tradebar
2016-12-19 20:40:37 +01:00
Michael Handschuh 5809527a95 Scan consolidators to emit based on time
Currently, most consolidators rely on receiving a piece of data after
the consolidation period before firing the consolidated event. This
introduces a lag in the results. We've mostly gotten around this  for
the most common case through usage of the IdentityConsolidator.

The issue arises when considering fill forward behavior and subscriptions
with different resolutions.

Consider a Minute subscription a Daily subscription. Default behavior will
fill forward that daily bar on every minute. If your indicator is based on
the IdentityConsolidator, then it will receive the same price update for
each minute the security trades that day.

By scanning the consolidators based on time, the consolidator is able to
determine that it is indeed time for it to emit a new consolidated bar.
This removes the need for the IdentityConsolidator while also fixing the
aforementioned bug.
2016-11-15 23:36:26 -05: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
Alexandre Catarino 47a75771c6 Implements the RegressionChannel indicator (#584)
* Adds Intercept and Slope members in LeastSquareMovingAverage

* Implements the RegressionChannel indicator

The Regression Channel indicator extends the LeastSquaresMovingAverage with the inclusion of two (upper and lower) channel lines that are distanced from the linear regression line by a user defined number of standard deviations.
Adds tests.

* Renames Regression Channel properties

Remove *Line from Regression Channel properties
Adds reference

* Adds RegressionChannelAlgorithm

Adds RegressionChannelAlgorithm
Minor changes on the indidicator
Adds tests for the channels

* Intercept and Slope becomes IndicatorBase instead of WindowIndicator

* Fix LSMA Next Value calculation
2016-10-10 11:48:09 -04:00
Juan José D'Ambrosio 96d9aeae4e Parameterless contructors for some CandleStickPatterns (#569)
* Parameterless constructors to CandleStickPatterns.

* LOGR method fixed.

* LogR fix... really.

* .gitignore reverted.
2016-09-29 18:02:07 -04:00
jameschch@outlook.com 18f3bbe4c2 Add remaining SWISS tests 2016-06-08 10:29:27 +01:00
jameschch@outlook.com 830692f7ad Adds SWISS factory method 2016-05-31 15:06:41 +01:00
jameschch@outlook.com 92728c386d Adds FRAMA external data testing 2016-05-26 11:27:28 +01:00
jameschch@outlook.com 4001cf8a8b Adds FRAMA factory method 2016-05-25 15:38:36 +01:00
AlexCatarino 34b664460d Adds VWAP indicator via WeightedBy indicator extension
Adds WindowIdentity indicator and its test. We need this at WeightedBy to keep values and weights at sync (same sample number).
Adds WeightedBy indicator extension and a simple test in IndicatorExtensionsTests
Adds VolumeWeightedAveragePriceIndicator (VWAP indicator), its test and external data file for testing.
2016-04-21 19:34:52 -03:00
Stefano Raggi 6b0fa8259a PercentagePriceOscillator now derives from AbsolutePriceOscillator 2016-03-24 02:18:21 +01:00
Stefano Raggi ad60c42e75 Adds PercentagePriceOscillator indicator (PPO) 2016-03-23 21:15:39 +01:00
Stefano Raggi 890d668653 Adds AbsolutePriceOscillator indicator (APO) 2016-03-23 20:53:08 +01:00
Michael Handschuh 2b6ca278b8 Merge branch 'midprice-indicator' of https://github.com/StefanoRaggi/Lean into StefanoRaggi-trix-indicator 2016-03-22 11:14:54 -04:00