Commit Graph

352 Commits

Author SHA1 Message Date
Martin-Molinero ff5fc5db5d HistoryRequestFactory Hour ExtendedMarketHours (#4786)
- `HistoryRequestFactory` will not sure extended market hours for hour
  resolution when determining the start time using quantity of bars.
  Adding regression test
2020-09-29 18:16:27 -03:00
Adalyat Nazirov 1e3a1e3c43 Historical data requests start & time fix (#4733)
* regression tests

* fix: apply the same time convertion to history request time as for data time

* ver2

* fixup

* unit tests

* do not need this conversion because RoundDownInTimeZone returns in proper TZ

* comment

* requested changes

* refactoring

* more refactoring

* fix existing test: should return Sunday if open

* more symbols

* fix existing tests: submit new btcusd data

* fix

* add Cfd symbol
2020-09-24 14:51:35 -03:00
Colton Sellers f135fb8060 Bug Backtesting Brokerage Clones (#4644)
* fix order updates

* Fix option exercise issue

* Regression changes

* Update regressions to reflect fixes

* Refactor handling of order to fully fix #2846

* Regression Algorithm for unit test

* Pre review

* Fix breaking tests

* OrderImmutability Regression Algo

* OrderImmutability Regression Algo Compile

* Address review

* Update regressions with new orderhash
2020-09-09 19:44:56 -03:00
Adalyat Nazirov 7bb143b215 Bug 4031 Change data depending on configuration (#4650)
* Calculate both raw and adjuasted prices for backtesting

* disable second price factoring

* move and reuse method

* test coverage for new methods

* reuse scaling method

* reuse subscriptionData.Create method

* removed unused code

* regression test

* switch to aapl

* fix regression test output

* more asserts

* fix comments - reduce shortcuts and abbrevation

* more comments

* merge parameters

* reduce number of getting price factors

* fix tests

* fix tests

* fix regression tests

* calculate TotalReturn on demand

* include TotalReturn calculations

* perf tuning

* more unit tests for SubscriptionData.Create

* simplify things - store and return only raw and precalculated data

* fix regression tests; change it back

* factor equals 1 for Raw data

* small changes

* follow code style

* implement backward compatibility
2020-09-09 18:40:19 -03:00
Adalyat Nazirov 808fa327e2 Fix duplicated history entries when contains daylight saving time change (#4700)
* regression test

* fix

* add comments

* more humanic implementation

* unit tests

* more comments
2020-09-09 13:57:40 -03:00
Derek Melchin 20791d6a9e Add schedule queuing algorithm (#4695)
* Add schedule queuing algorithm

* Add algorithm file to csproj file

* Add c# version of queuing algorithm
2020-09-04 12:34:07 -07:00
Gerardo Salazar b866c8b893 Removes Robintrack data source (#4628) 2020-08-14 19:46:30 -03:00
Colton Sellers c5c57a33c1 IDE & Docker Integration (#4576)
* Mount custom algorithms to container

attach algorithms with bash script

* VS Code Integration

* PyCharm Integration

* Simplify the run docker script

* Mono C# Debugging is broken, removed related tasks

* add OSX config for run-docker

* Update readme.md

Reflect latest changes to configuration

* Update to move pdb for debugging algos

* VS Code C# Debugging fix

* Visual Studio fixes for debugging C#

* rework of launch scripts; also allows inline args

* Documentation overhaul

* Add python directory arg

* address review

* List debugging options in config

* Undo unnecessary change

* Address review and bughunt

* remove python debugging method
2020-08-02 19:45:18 -03:00
Colton Sellers a72e3f0598 Add new regression trading algorithm 2020-06-25 15:26:30 -07:00
Martin Molinero b575880739 Coarse tiingo new universe selection algorithm
- Adding an example algorithm of a custom universe selection using
  coarse data and adding tiingo news. If conditions are met will add the
  underlying and trade it
- Adding required UniversePythonWrapper
2020-06-15 20:05:08 -03:00
Martin Molinero 03e10101cc Fix Delisted.Warning event time
- Fix Delisted.Warning event time, some futures add hours to their
  expiration date. Adding regression algorithm
2020-06-08 20:01:12 -03:00
AlexCatarino f008e90202 Adds EmaCrossFuturesFrontMonthAlgorithm
This example shows how to create an EMA cross algorithm for a futures' front contract. Once the contract is added, the indicators are registered to a new consolidator and warmed up with historical data. When a contract is removed, the consolidator is removed and the indicators are reseted. We don't need to liquidate it, because it's liquidated automatically since it has expired.
2020-06-04 00:21:49 +01:00
Martin-Molinero 9385707061 Merge pull request #4407 from michael-sena/feature-open-interest-future-universe
Add a futures universe selection model that uses open interest
2020-05-18 12:47:52 -03:00
Michael Sena a5d7bdafde Add a futures universe selection model that uses open interest 2020-05-19 00:30:58 +10:00
Martin Molinero 891cf4d69b Update to .Net 4.6.2 2020-05-15 17:32:46 -03:00
Martin Molinero 269b8ba204 Remove PsychSignal data
- Remove PsychSignal data since it's no longer available
2020-05-11 18:48:13 -03:00
Gerardo Salazar d3a5f52fe9 Implements Robintrack BaseData and example algorithms 2020-05-07 16:26:15 -07:00
Martin Molinero 1c3c2e810e Address review
- Minor fixes
- Adding regression algorithm adding futures with the same ticker
  different market
2020-04-28 16:29:54 -03:00
Martin Molinero 89a73a5671 Fix and regression tests
- Fix FineFundamentalFilteredUniverse for a custom universe
- Adding regression test
2020-04-24 17:21:28 -03:00
Martin Molinero fa819126c9 Improve implicit conversion failure message
- Improve string to Symbol implicit conversion exceptions message
2020-04-17 22:11:24 -03:00
Jared 26c8483bc5 Merge pull request #4306 from QuantConnect/feature-4287-partial-fill-model-algo
Adds CustomPartialFillModelAlgorithm
2020-04-13 13:03:24 -07:00
AlexCatarino e23d7e4486 Adds CustomPartialFillModelAlgorithm
This basic algorithm implements a `CustomPartialFillModel` class that chnages the behavior of the `FillModel.MarketFill` to simulate partially fill orders.
2020-04-13 18:50:03 +01:00
Martin Molinero 58f91b872a Add OrderSubmission data regression algorithm
- Add OrderSubmission data regression algorithm asserting it's correctly
  set and does not use static data
2020-04-09 11:42:23 -03:00
Martin Molinero 6ad123ad8c Update regression algorithms stats
- Update regression algorithms stats after making SecurityCache ignore
  QuoteBars for equity for OHCL values and GetLastData(). They were
  affected since the `BenchmarkSecurity` used `.Price` which was QB for
  equities. Order list hashes changed because SubmissionLastPrice will
  now be TB instead of QB
2020-04-08 19:31:42 -03:00
Martin Molinero 499248fe12 Revert "Revert "Adding Support for Equity L1 Quote Data""
This reverts commit 8cd8d206ca.
2020-04-06 10:32:59 -03:00
Martin Molinero 982ab3099f Remove Order based insights
- Removing order based insight generator.
- Removing regression and unit tests.
2020-04-01 20:21:19 -03:00
AlexCatarino 72f0f44f60 Updates Pythonnet Version
From 1.0.5.29 to 1.0.5.30
Ref.: https://github.com/QuantConnect/pythonnet/pull/42
2020-04-01 16:15:05 +01: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 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 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
Juan José D'Ambrosio fd9de5895a Consolidate only trades, low resolution reads trades only, update tests
Crypto and Equities will consolidate trades by default

Daily and hourly resolution will return only trades for crypto and equities. 
Update equity TAQ regression test 

Add minute sample files

Updating regression algorithms

Update SpotMarket test cases

Add regression test for equity trades and quotes
- History request.
- Trades and quotes pumped into OnData.
- Subscriptions are added correctly.

Add sample data

Checks low resolution only subscribes to trade bars
2020-03-11 14:34:05 -03:00
Martin Molinero 2f4f7dc2cb ScheduledEvents fire in order
- Scheduled events will fire in order even after market hours
- Improving scheduled events performance
- Adding regression and unit test
2020-03-02 11:05:54 -03:00
AlexCatarino c2ff03caad Implements PortfolioBias in EWPCM and IWPCM
Implements `PortfolioBias` in EWPCM, CWPCM and IWPCM. With this new feature, these PCM will ignore insights that do not respect the desired bias. E.g. for `PortfolioBias.Long`, on Insights with `InsightDirection.Up` will be converted into `PortfolioTarget.Quantity` greater than zero and other `InsightDirection` will result in `PortfolioTarget.Quantity` of zero.
2020-02-20 19:29:12 -03:00
AlexCatarino 21ce895c18 Implements SectorWeightingPortfolioConstructionModel
Provides an implementation of `IPortfolioConstructionModel` that generates percent targets based on the `CompanyReference.IndustryTemplateCode`.
2020-02-17 22:08:06 +00:00
Martin Molinero e12788375b Adding IDateRule rebalacing PCM
- Adding IDateRule to be used by the PortfolioConstructionModel as
rebalancing function.
- Adding unit tests and C#/Py regression algorithms
2020-02-13 18:23:15 -03:00
Martin Molinero 0845f0802d Unknown next rebalance time
- Adding new `Func<DateTime, DateTime?>` that allows PCM to return null
if the next rebalance time is null, in which case the function will be
called again in the next loop.
- Adjusting PCM next rebalance time check to perform rebalance once the
time is reached
- Adding new regression test. Updating existing
2020-02-13 16:10:52 -03:00
Martin Molinero e6d07d6305 Add new regression algorithms
- Adding new regression algorithms setting PCM.RebalanceOnSecurityChanges
and PCM.RebalanceOnInsightChanges to false
2020-02-11 17:36:27 -03:00
Martin Molinero b51ae82900 Address reviews
- Add new regression algorithm which expects no regression call to
happen
2020-02-05 20:26:17 -03:00
Martin Molinero 9aa6a7062e Fix margin call on closed market
- `FutureMarginModel` and `PatternDayTradingMarginModel` will adjust
margin requirements before market closes using the new `Exchange.ClosingSoon` property
- Adding unit tests and regression algorithm
2020-02-05 18:53:51 -03:00
Martin Molinero 6eb45baa59 Refactor GetMaximumOrderQuantityForTargetBuyingPower
- Refactoring `GetMaximumOrderQuantityForTargetValue` into
`GetMaximumOrderQuantityForTargetBuyingPower` which algorithm uses
margin
- Reducing code duplication
- Adding unit tests
- Fixing futures margin model. Adding intra day logic.
2020-02-04 18:41:15 -03:00
Gerardo Salazar dfee825ef6 Refactors sampling strategy in AlgorithmManager loop
* Refactors AlgorithmManager loop
* Refactors StatisticsBuilder methods and strategy for series alignment
* Move sampling logic to the corresponding IResultHandler
* Changes benchmark resolution to Resolution.Hour
* Modifies IResultHandler to enable external sampling
* Adds BacktestResultHandler unit tests
* Adds ResolutionSwitchingAlgorithm to test misalignment
* Adds support to AlgorithmRunner to store algorithm IResultHandler

Warning: this commit breaks accurate calculations for algorithms that
only make use of `Daily` resolution data. Previously, because
the benchmark was added in Daily resolution in backtesting, any
algorithm that only made use of daily data would have an accurate
calculation for beta and various other statistics.

These changes serve to fix the statistics calculations of non-daily
resolution algorithms, with daily resolution to be revisited at a later
time.
2020-01-16 14:03:54 -08:00
Jared b95973cf69 Merge pull request #3940 from wardjm/feature-accumulative-model
Feature accumulative model
2020-01-14 13:57:10 -08:00
Martin Molinero 6cd12abff4 Remove duplicate EndOfDayEvent for Symbols
- Remove duplicate EndOfDayEvent for Symbols added with `AddData` calls
- Adding regression test
2020-01-14 18:06:52 -03:00
Jeffrey Ward a296d346a4 Pull request fixes. 2019-12-20 18:01:35 -05:00
Michael Handschuh d6f1dd8630 Add ObjectStoreExampleAlgorithm
Shows how to read/save object store entires. In this case, it shows a
use case where a potentially time intensive operation's result is saved
in the object store and on subsequent runs the result is pulled directly
from the object store to enable faster run times
2019-12-18 08:46:14 -05:00
Martin Molinero 491cae2c1d Fix ProcessSplitSymbols exception
- `UserDefinedUniverse` will no longer be removed as a data subscription.
- When `algorithm.AddData()` is called a universe selection data point
will be added to the `UserDefinedUniverse` subscription to trigger
selection and add the requested data.
- `DataManager` will make sure an active subscriptions
`SubscriptionDataConfig` will be present in the configuration collection
- Adding unit and regression tests
2019-12-12 17:14:47 -03:00
Jared ec4f714799 Merge pull request #3862 from gsalaz98/feature-3775-add-benzinga-custom-data
Implements Benzinga Custom Data
2019-11-27 15:39:22 -08:00