Commit Graph

162 Commits

Author SHA1 Message Date
Jovad Uribe fc6ccdbc11 Feature emv indicator addition (#4591)
* Create EaseOfMovementValue.cs

Added ease of movement file

* Update EaseOfMovementValue.cs

Added calculation for EMV and return its value

* Update EaseOfMovementValue.cs

* Update EaseOfMovementValue.cs

* Update EaseOfMovementValue.cs

* Update EaseOfMovementValue.cs

Rearranged code and removed all IndicatorBases

* Update EaseOfMovementValue.cs

* Update EaseOfMovementValue.cs

Added Min and Max Indicator

* Added Tests and Compile

* Fixed Bugs and Removed Reset

* Added Current Value and revereted to Bar data

* Fixed test file and refined indicator file

* TradeBar to IBaseDataBar

* Bug fixes

* bug fix

* Switching to TradeBar and attempting to fix Volume bug

There are two bugs that I have been having trouble fixing. 1. Cannot implicitly convert decimal to int (simple fix but cannot find where bug is taking place)
2. IBaseDataBar does not contain a definition for Volume

* Update EaseOfMovementValueTests.cs

* bug fix

* added data

* updated assertion

* added reset

* Update EaseOfMovementValueTests.cs

* Update EaseOfMovementValue.cs

* Update spy_emv.txt

I had the wrong test data in. Was throwing failed test for many pull requests.

* Update EaseOfMovementValue.cs

* Update EaseOfMovementValue.cs

* Update EaseOfMovementValue.cs

* Update EaseOfMovementValue.cs

* Cleaned Data

* Bug fixes

Fixed zero division error. Used better Test Data.

* removed readonly from _previous...price

* Update EaseOfMovementValue.cs

* Update EaseOfMovementValue.cs

* Update EaseOfMovementValue.cs

* bug fix

* Test Bug Fix

* EMV data from online

* Cosmetics

* Out of bounds fix

* Update EaseOfMovementValueTests.cs

* Update spy_emv.txt

* Update spy_emv.txt

* Added changes requested

Placed constructor first, fixed nullable type if statement, set 10,000 to default argument, added SMA.

* Update EaseOfMovementValue.cs

added variables

* Update EaseOfMovementValue.cs

* Update EaseOfMovementValue.cs

* Update EaseOfMovementValue.cs

* Fixed bugs

* Changed Delta, Added Assert

Create Indicator -> Update EMV -> Assert Status. Also changed delta from 1 to 0.000001 to improve test accuracy.

* Added unit test testing the SMA
2020-08-24 09:54:58 -03:00
Colton Sellers 64a99d1194 Feature shorcut helper for STC (#4623)
* Shorcut helper for STC

* Use name variable
2020-08-12 14:41:20 -03:00
Adalyat Nazirov e37c9dbb1a fix CreateIndicatorName; add unit tests 2020-07-31 22:50:31 +03:00
Adalyat Nazirov c2cac7fbee remove unused using 2020-07-31 22:03:57 +03:00
Adalyat Nazirov 22155bf3ce add extension methods for new indicators 2020-07-31 21:13:56 +03:00
AlexCatarino fffd6a8493 Adds Optional Parameters to KaufmanAdaptiveMovingAverage
Our reference, http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:kaufman_s_adaptive_moving_average, points to three parameters, but only one is defined. The missing parameters were added to reflect the reference.
2020-05-31 14:44:53 +01:00
Martin Molinero 20909a9569 Reduce some code duplication
- Small refactor to reduce some code duplication in
QCAlgorithm.Indicators Consolidate and ResolveConsolidator
2020-03-26 11:06:47 -03:00
Martin-Molinero e0f595cfd2 Merge pull request #4238 from QuantConnect/bug-4205-warmup-indicator-type
IndicatorWarmup data type fixes
2020-03-25 21:25:57 -03:00
Martin Molinero 2c950bc740 Improve comments
- Improve comments with an example
- Remove reference to regression algorithm
2020-03-25 21:21:13 -03:00
Martin Molinero f4e9b0cc3d Address reviews
- Add more and improve existing comments
2020-03-25 20:38:22 -03:00
Martin Molinero 2a2711d056 IndicatorWarmup fixes
- WarmupIndicator will be able to determine the correct type to use
- Fix bug in `History.GetMatchingSubscriptions()` which would use the
same TZ for exchange and data. Covered by regression algorithm.
- Consolidate will only infer `TickType` from `T` is not abstract
- Adding regression algorithm
- Slice will expose `Get(Type)` to get data by type, adding unit tests
2020-03-25 18:52:48 -03:00
Martin Molinero ccaa643bc7 Address self review
- Remove unrequired symbol check
- Dispose of `ZipDataCacheProvider` used in unit tests.
To avoid issues with other tests since zip files could remain open.
2020-03-25 17:41:11 -03:00
Martin Molinero 15cbe4afa2 Refactor QCAlgorithm.Indicators
- Make `GetSubscription` private and remove unrequired overload
- Add warning message when trying to warm up an indicator which does not
have a warm up period
2020-03-25 16:51:26 -03:00
Martin-Molinero 13431b11c1 Merge pull request #4236 from QuantConnect/bug-4205-registerindicator-of-t
Fixes for RegisterIndicator API
2020-03-25 10:55:43 -03:00
Martin Molinero 085da7c352 Fixes for RegisterIndicator
- Fixes for C# RegisterIndicator API methods which were ignoring provided
type of T
- Fixes for Py RegisterIndicator API methods which was not using the
provided 'selector' method
- Adding C# and Py regression algorithm
2020-03-24 16:38:46 -03:00
Martin Molinero eb533b9954 Fixes for QCAlgorithm.Indicators.Consolidate API
- Fixes for 3 QCAlgorithm.Indicators.Consolidate API methods
- Adding C# and Py regression test
2020-03-23 21:16:33 -03:00
Martin-Molinero 899ea03a1c Merge pull request #4227 from QuantConnect/bug-3861-indicator-warmup
Fix WarmupIndicator duplicate consolidator
2020-03-23 18:49:57 -03:00
Adam May 9049d753aa Adding overload to QCAlgo.EMA to support smoothing factor 2020-03-20 10:48:51 +11:00
Martin Molinero 5242cc57f4 Fix WarmupIndicator
- WarmupIndicator will remove and dispose added consolidators
- Consolidating duplicated implementation
- Adding regression test
2020-03-19 18:06:05 -03:00
Jared 8cd8d206ca Revert "Adding Support for Equity L1 Quote Data" 2020-03-11 19:16:05 -07:00
Martin Molinero 21f636fecc Fix undeterministic unit test
- Fix underterministic python indicator unit test
- Refactor `QCAlgorithm.Indicators.GetSubscriptions`
2020-03-11 14:34:13 -03:00
Martin Molinero 8f50691927 Update documentation 2020-02-14 19:59:22 -03:00
Michael Handschuh d8db9f9fce Update Algorithm to respect CA1304 and CA1305
Updates all occurrences of parsing/ToString-ing to go through the new
StringExtensions methods that use CultureInfo.InvariantCulture

See #3045
2019-09-12 15:30:44 -04:00
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