Commit Graph

338 Commits

Author SHA1 Message Date
AlexCatarino 84d548b5f2 Adds Custom Python Indicator Support for QCAlgorithm.PlotIndicator
In order to add support custom python indicators for `QCAlgorithm.PlotIndicator`, we created a `PythonIndicator` class that wraps the custom python indicator. In `QCAlgorithm`, the reference of the wrapper is saved into a dictionary keyed by the python indicator handle.
2019-07-23 22:02:33 +01:00
Gerardo Salazar 2033c7873b Update outdated DotNetZip dependency in nuspec files 2019-07-02 18:02:23 -07:00
Martin Molinero f6b5e92a96 Add conditional optimization flag 2019-06-19 16:11:15 -03:00
AlexCatarino d9be8e5001 Extends SwissArmyKnife, Trix and WilderMovingAverage Indicators With IIndicatorWarmUpPeriodProvider 2019-06-05 18:10:22 +01:00
Jared d19402592d Merge pull request #3226 from AlexCatarino/feature-3074-indicator-warmup-t3-trime-tema
Extends T3, Triangular and TripleExponential Moving Averages Indicators With IIndicatorWarmUpPeriodProvider
2019-05-28 10:14:51 -07:00
Jared 9373d2f56d Merge pull request #3225 from AlexCatarino/feature-3074-indicator-warmup-obv-psar-rc
Extends OnBalanceVolume, ParabolicStopAndReverse and RegressionChannel Indicators With IIndicatorWarmUpPeriodProvider
2019-05-28 09:25:07 -07:00
AlexCatarino dc254945f8 Extends T3, Triangular and TripleExponential Moving Averages Indicators With IIndicatorWarmUpPeriodProvider 2019-05-23 10:18:24 +01:00
AlexCatarino 1163f9c663 Extends OnBalanceVolume, ParabolicStopAndReverse and RegressionChannel Indicators With IIndicatorWarmUpPeriodProvider 2019-05-23 10:08:48 +01:00
AlexCatarino 20aad77176 Addresses Peer-Review 2019-05-23 09:59:03 +01:00
AlexCatarino 30bc74984e Extends RelativeStrengthIndex, Stochastic and WilliamsPercentR Indicators With IIndicatorWarmUpPeriodProvider 2019-05-23 09:54:02 +01:00
AlexCatarino dd6bbf91fb Extends PercentagePriceOscillator and UltimateOscillator Indicators With IIndicatorWarmUpPeriodProvider 2019-05-17 15:36:23 +01:00
Jared fd292d4394 Merge pull request #3196 from AlexCatarino/feature-3074-indicator-warmup-std-var
Extends Sum, StandardDeviation and Variance Indicators With IIndicatorWarmUpPeriodProvider
2019-05-17 07:26:29 -07:00
AlexCatarino 9553857c1c Extends Sum, StandardDeviation and Variance Indicators With IIndicatorWarmUpPeriodProvider 2019-05-15 14:44:35 +01:00
AlexCatarino 777c6a993f Extends NormalizedAverageTrueRange and TrueRange Indicators With IIndicatorWarmUpPeriodProvider 2019-05-15 14:31:22 +01: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 c3de660551 Updates pythonnet to 1.0.5.20 2019-04-23 23:15:14 +01:00
AlexCatarino d1a4837cf9 Adds Review on ExponentialMovingAverage 2019-04-18 23:39:49 +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 294ae66731 Implements IIndicatorWarmUpPeriodProvider Interface
- `IIndicatorWarmUpPeriodProvider` represents an indicator with a warm up period provider.
- `SimpleMovingAverage` and `ExponentialMovingAverage` implement `IIndicatorWarmUpPeriodProvider`.
2019-04-18 23:28:48 +01:00
Juan José D'Ambrosio ef6bb4f81d Enable Acceleration Bands support for QuoteBars 2019-04-11 16:11:30 +00:00
AlexCatarino da6519b9f4 Updates pythonnet to 1.0.5.19
Updates PythonNet to 1.0.5.19
 - Related  https://github.com/QuantConnect/pythonnet/pull/28/
2019-04-02 17:17:40 +01:00
AlexCatarino 6d2460d8ed Updates pythonnet to 1.0.5.18
- Updates PythonNet to 1.0.5.18
  - Cherry picks the memory leak fix from upstream/pythonnet
2019-03-28 00:47:38 +00: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
AlexCatarino d91cad3123 Updates pythonnet to 1.0.5.17
- Updates PythonNet to 1.0.5.17
  -  Improve performance by adding new `interop` `type` cache holding a `bool`, true if its an `exception`. And adding a `setter` and `getter` cache for the `propertyobject`. Closes #2925.
  - Decimal parsing allows numeric string in exponential notation. Closes #2918 #2919.

Closes #2929
2019-02-22 17:46:59 +00:00
Martin Molinero d53a922cf0 PythonNet installation does not require copy pasting
- Requires a new PythonNet 1.0.5.15 package where the different `.dll` are in a
specific folder: `\win` `\linux` and `\osx`
- Removed not present `decimal.py` from `Algorithm.Python` project. It
was moved into `Common`.
- Replace `xbuild` for `msbuild` required for using the `System.Runtime.InteropServices`.
Also note the `xbuild` on travis prints:
> >>>> xbuild tool is deprecated and will be removed in future updates, use msbuild instead <<<<
2019-01-22 19:48:11 -03:00
AlexCatarino ef59fa7ba2 Updates pythonnet package.
In the new package:
- C# decimal conversion will use C# double and python float due to the big performance impact of converting C# decimal to python decimal;
2019-01-18 23:18:35 +00:00
Martin Molinero fb3e5bf6e7 Fix bolliger lower and upper bands double update
- Lower and Upper bands from the BollingerBands indicator are a
`CompositeIndicator` that gets updated automatically when both left and
right are updated. So there is no need to update them
again. Same happens in the `RegressionChannel` indicator. Adding unit
tests.
2019-01-08 16:22:17 -03:00
AlexCatarino 823bb01438 Updates pythonnet
Includes memory leak fix (https://github.com/QuantConnect/pythonnet/commit/c6db86653e7fa4fa89e1f8404d72e346b67ed857 and https://github.com/QuantConnect/pythonnet/commit/bec9563d2958acc5adf3e8972b23609fe3914402)

- Fix python version to 3.6.6 (avoid updating to 3.7)
- Fix numpy version to 1.14.5 (tensorflow requirement)

- Adds py-earth python package (closes #2399).
2018-12-07 09:36:48 +00:00
Stefano Raggi 57d50c69c4 Fix XML documentation compiler warnings
- Fixed all warnings except for missing XML comments (CS1591)
2018-11-09 11:44:03 +01:00
AlexCatarino fcb70a61e7 Prevents Negative Variance
Prevents negative variance (mathematically impossible) in Variance
indicator.
Since variance is used to calculate standard deviation, we found that
negative variance yield double.NaN and, consequently, an arithmetic
overflow when we convert NaN into decimal.

Closes #2672
2018-11-06 13:58:41 +00:00
AlexCatarino bb99123c19 Refactors AverageDirectionalIndex and AverageDirectionalMovementIndexRating
- Fixes `TrueRange` computation: it was not using the H-L range;
- Fixes `SmoothedDirectionalMovementMinus` that used a constant value instead of the defined period;
- Use a `WilderMovingAverage` to compute ADX based on DX.
- Fixes `AverageDirectionalMovementIndexRating` only be ready when there is enough past values.
- Removes external data for `AverageDirectionalMovementIndexRating` and points to column in `AverageDirectionalMovementIndex` external data.

Closes #2666
2018-11-02 22:53:20 +00:00
Martin Molinero 52d80e74f0 Indicator extensions support all indicator types 2018-08-14 18:14:46 -03:00
AlexCatarino 8e3b7153b2 Rebase with pythonnet/master and fix datetime UTC bug
Updates pythonnet with pythonnet/master and fix datetime issue ([65ac279](https://github.com/QuantConnect/pythonnet/commit/65ac279a03dbded39fe3e28bb79c233f0c970f6f)).
2018-07-16 11:52:54 +01:00
Juan José D'Ambrosio bda5b11cc2 Nuspec files added for all projects.
Launcher project is packed as `QuantConnect.Lean`but as a mean ot having all Lean features just calling one package. 

In the same sense, `QuantConnect.Algorithm.CSharp` is included as package and added as dependecy in the `QuantConnect.Lean` package just to have a working example aailable out-of-the-box.
2018-04-13 07:28:34 -03:00
Michael 4eda0e659d Merge pull request #1825 from AlexCatarino/feature-1821-updates-pythonnet
Updates QuantConnect.pythonnet to 1.0.5.7
2018-04-09 15:38:49 -04:00
AlexCatarino a4db921b87 Updates pythonnet
Rebase with pythonnet/master
2018-04-09 18:59:59 +01:00
AlexCatarino 2c11302d93 Sets RollingWindow fields to readonly 2018-04-09 18:53:23 +01:00
AlexCatarino e793118d50 Refactors FractalAdaptiveMovingAverage
A constructor overload was missing in the previsous version. In the indicators' pattern they have constructors that don't need a string as the first parameter.
Refactored the code to implement QuantConnect's code style.
2018-04-09 18:50:08 +01: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
AlexCatarino fd5eebca50 Adds Reset method override in WilderMovingAverage 2018-04-05 13:54:29 +01:00
AlexCatarino 403bafc3ca Implements WilderMovingAverage indicator
Implements the `WilderMovingAverage` indicator. It is a special exponential moving average which uses a simple moving average as seeding.
2018-03-21 00:13:37 +00:00
Juan José D'Ambrosio de0926834e Fixes MACD's Signal and Histogram warming up
Formatting test file


tiny format fix


Historgram test fixed


external data from free stock charts


new testing data without pandas
2018-03-06 20:03:15 -03:00
Juan José D'Ambrosio 5c2c7224e2 MACD EMA as default 2018-02-28 23:49:15 -03:00