Commit Graph

141 Commits

Author SHA1 Message Date
Adalyat Nazirov a4f66628fd Lean Optimization interface in QCAlgorithm (#4923)
* initial commit

* run parametrized algorithm with command line parameters

* skeleton: top level structure

* OptimizationNodePacket scheme

* pass parameters as HashSet

* run Lean and read results

* call method on optimization completion

* refactor public interfaces

- close ParameterSet collection; allow only get operations
- explicit method to start LeanOptimizer

* synchronize RunLean method; the result could come in before the backtest id is set in the collections

* another portion of refactoring and interface changes

* comments

* comments & tests for Extremum, Minimization and Maximization classes

* unify optimization paramater values (min, max, step) & mode GridSearch tests

- swap min&max if necessary
- iterate left => right (negate step value if necessary) & provide default step value if step == 0
- no StackOverflow Exception
- parameterSet Id should be global for current generator and retain between steps
- test signle point boundary (min == max)

* BruteForceStrategy tests

* more comments

* Update Optimizer assembly information

- Update Optimizer projects assembly information to match behavior of
  the other projects

* Tweaks

- Adding comments
- Replace OnComplete for Ended event
- Replace Abort for Dispose
- ConsoleLeanOptimizer will keep track of running processes
- Each backtest will store results in a separated directory, so they
  don't fight for the log.txt file.
- Adding cmdline option for lean to close automatically
- Adding concurrent execution backtest limit
- Console optimizer will start Lean minimized
- Escape spaces in Json path

* remove parameter set generator abstraction layer

we don't need this flexibility now.

* refactor public methods; Step shouldn't be public

* constraints: wip

* define contract

* comparison operators and tests

* specify JsonProperty values

* Move SafeMultiply100 to extensions

* Throw exception on failed Optimizer.Start

* constraints: wip

* change finish & dispose process

* minor fixes

- handle force lean abort
- notify consumer if target has been reached

* target & constraints; adapt unit tests

* Minor Tweaks and fixes

- Some logging improvements
- Remove Public since not required

* Ignore empty ParameterValue

* simplify condition

* avoid reinitialization

* reduce type; force immutable

* unit tests for constraints  and target value

* parse & normalize percent values, i.e. 20% => 0.2

* fixup

* Target & Constraint & OptimizationNodePacket unit tests

* Add more json unit tests

- Adding more json conversion unit tests. Fix bug for Extremum which
  wasn't using the converter.

* LeanOptimizer tests

* Estimation results

* User thread safe counters

* LeanOptimizer unit tests; push OptimizationResult on Ended event

* more unit tests

* Minor tweaks

-Estimate ToString in a single line.
-Typos and missing header file

* Add base SendUpdate method

- Add base SendUpdate method for LeanOptimizer

* fix LeanOptimizer test; rely on internal Update rather than timer

* Add OptimizationStatus

- Add missing commments and OptimizationStatus

* EulerSearch implementation: wip

* OptimizationParameter custom converter

* change the type

* make step optional

* change folder structure

* enumerate optimization parameter using IEnumerable & IEnumerator

* unit tests: parameters & objectives

* unit tests: strategies

* remove redundant TODO

* change Euler search boundaries

* more Euler tests

* prevent race condition

* Add account/read endpoint

- Adding account/read endpoint. Adding unit test

* Add status check before running lean

* Minor self review

- Adding missing comments, minor changes

* remove array parameters

* minor changes

- tidy up config file, rename variable
- accept min less or equal than max

* move OptimizationParameter methods to strategies

* Minor improvements for BaseResultHandler derivates

* minor changes

- strict requirements for Step and MinStep values
- strategy specific settigs

* Add TotalRuntime to estimate

Co-authored-by: Martin Molinero <martin.molinero1@gmail.com>
2020-12-02 20:10:40 -03:00
Jared 4252c79e45 Create QuantConnect-Platform-2.0.0.yaml
Initial commit of QuantConnect Platform Yaml.
2020-10-18 17:46:13 -07:00
Colton Sellers 8792fa2600 Standardize API.cs to use JSON Objects (#4868)
* Standardize API to use JSON Objects

* Address review
2020-10-15 20:24:55 -03:00
Colton Sellers e05a6bffd0 Bug 4835 api tests failing (#4838)
* Remove F# Project, Splits, and Dividends Tests

* Separate tests that require external accounts; read from config

* Removal of non supported "prices" endpoint test

* Removal of unsupported API functions

* Address review

* NOP GetLastPrice for removal of Prices endpoint

* Post rebase fix

* Rebase fix 2

* remove /r/n from eof for api tests

* Reflect similar refactors to NodeTests

* Fix for live algorithm API testing

* Address Review
2020-10-15 13:31:53 -03:00
Michael Handschuh cc83f19528 Rename QuantConnect.API to QuantConnect.Api (#4830)
Also renames API folders to Api
2020-10-08 19:35:57 -03:00
Martin-Molinero 400a0d42d9 Add internal subscription manager (#4678)
* Add internal subscription manager

- Add InternalSubscriptionManager that will handle internal
  Subscription. Replaces the realtime updates
- Fix thread race condition in the TimeTriggeredUniverseSubscription, we
  have one thread injecting data points, the main algorithm thread, and
  the base exchange is pulling from it
- Fixes for FakeDataQueue
- Adding unit tests

* Address reviews and fixes

- Internal subscription will use extended market hours
- Only sample charts accordingly
- Get api-url once
2020-09-01 21:22:22 -03:00
Stefano Raggi 38ce10c723 Remove unused references to WebSocketSharpFork 2020-07-30 14:06:22 +02:00
Colton Sellers 5188d0cb7f Documentation update 2020-07-10 12:28:38 -07:00
Colton Sellers df7bc89d9b Address review 2020-07-08 14:37:58 -07:00
Colton Sellers 831e1c0b78 Address reviews v2 2020-06-24 18:02:13 -07:00
Colton Sellers 053925829c Address review 2020-06-24 17:44:15 -07:00
Colton Sellers 4263afab9f Removed all unnecessary new lines 2020-06-24 17:06:21 -07:00
Colton Sellers d0fdae71b4 addition of stopNode & new return type for createNode 2020-06-24 15:52:45 -07:00
Colton Sellers 172f086d07 Using new NodeList for NodeRead 2020-06-23 16:50:27 -07:00
C-SELLERS 62aac8e516 Addition of Node endpoint functions for CRUD 2020-06-23 12:13:29 -07:00
Stefano Raggi 0a046699fc Consolidate SharpZipLib library usage 2020-05-28 11:18:44 +02:00
Martin Molinero 9631cd6749 Fix nuget QC dependency version 2020-05-21 16:21:59 -03:00
Martin Molinero 09c17b71ed Add assembly description to nuspec
- Due to bug in nuget failing to replace description and copyright token, setting
  .nuspec description to match assembly description
2020-05-21 14:42:12 -03:00
Martin-Molinero 1d0d4f4d7b Add assembly descriptions (#4442)
Add assembly descriptions
2020-05-21 09:35:12 -07:00
Martin Molinero 891cf4d69b Update to .Net 4.6.2 2020-05-15 17:32:46 -03:00
Stefano Raggi e0a08cbb8d Add XML documentation generation for release builds 2019-12-14 13:50:10 +01:00
Michael Handschuh bc1629a0fe Prevent null ref and log unsuccessful api responses 2019-12-10 19:09:00 -05:00
Michael Handschuh bcd358001f Update Api 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
Michael Handschuh c7df4e9fb3 Add StringExtensions and Parse utilizing CultureInfo.InvariantCulture
Adds static methods of the form Parse.<TypeName>(string str) that use
CultureInfo.InvariantCulture. These are to be used when parsing strings.
It's still safe (from the CA1304/CA1305 perspective) to use the ToDecimal
extension method for decimals.

Adds string extension methods for common operations that will now require
CultureInfo.InvariantCulture. These are to be used when converting values
to strings, such as ToStringInvariant()/ToStringInvariant(format), but also
useful for searching within strings, StartsWithInvariant, EndsWithInvariant
 and IndexOfInvariant.
2019-08-16 18:08:28 -03:00
Michael Handschuh 703f915182 Configure QuantConnect.ruleset in all projects
The initial ruleset is specifically aimed at addressing #3045. When we'd like
to start addressing other issues available via the FxCopAnalyzers, we can update
the action in QuantConnect.ruleset. A nice way to do it is to first set it to
warning, then go through the solution, project-by-project, fixing each warning.
At the end you can flip it to error and ensure it still builds. Moving forward,
any changes will fail if they violate the rule.

In support of #3045, we'll be configuring the following rules:
> CA1304: https://docs.microsoft.com/en-us/visualstudio/code-quality/ca1304-specify-cultureinfo?view=vs-2017
> CA1305: https://docs.microsoft.com/en-us/visualstudio/code-quality/ca1305-specify-iformatprovider?view=vs-2017
2019-08-16 18:08:18 -03:00
Michael Handschuh c42057809d Add Microsoft.CodeAnalysis.FxCopAnalyzers to all projects
FxCop has various rulesets for enforcing things within our codebase.
For this particular issue, we'll be enforcing CA1304 and CA1305 to
ensure we're always using an IFormatProvider or a CultureInfo where
applicable.

Linked Issue: #3045
2019-08-16 18:08:05 -03:00
Stefano Raggi e39791ac6c Upgrade RestSharp library from v105.2.3 to v106.6.10 2019-07-17 10:28:35 +02: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
Gerardo Salazar 340cc3a330 Upgrade dependency DotNetZip to version 1.13.3 to fix security issue 2019-06-11 11:03:37 -07:00
Stefano Raggi b74416bde6 Remove stacktrace from ApiConnection error logging
ApiConnection.TryRequest will now log only the error message instead of the whole stack trace, making it easier to read long system logs.
2019-06-06 21:39:01 +02:00
Jared Broad 9062357b30 Remote file provider powered by download provider 2019-05-24 17:01:52 -07:00
Jared 66c66abb12 Implement API download for QCALgorithm (#3215)
* Implementing download proxy for LEAN

* Remove accidentally added files

* Remove accidentally added files

* Tidy up
2019-05-20 18:34:19 -07:00
Stefano Raggi ff62554675 Add missing null check in Api.ReadPrices 2018-08-22 14:19:55 +02:00
Michael Handschuh a6640c0886 Adds API support for /splits and /dividends endpoints 2018-08-15 13:45:12 -04:00
Martin Molinero 10fd09be19 API endpoint prices will now return Symbol 2018-08-13 12:25:15 -03:00
Martin Molinero b253668b1d Adding new API endpoint prices 2018-08-04 10:57:41 -03:00
Michael Handschuh 9d918a2f49 Source api url from configuration 2018-07-27 18:09:18 -04:00
Michael Handschuh e079e5efa8 Add request.Resource to TryRequest error message 2018-07-27 13:29:22 -04:00
Michael Handschuh 96962c779e Remove erroneous whitespace from api classes 2018-07-06 01:08:09 -04:00
AlexCatarino 23c6ef8e0f Implements ReadBacktestReport method in the API 2018-06-08 17:04:13 +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
Martin-Molinero 4dccb7020d removing obsolete ApiWebSocketConnection 2018-03-15 17:18:56 -07:00
Martin-Molinero 259a0ab8ff Fix exception thrown login vs plugin 2018-03-14 17:28:55 -07:00
AlexCatarino 7c5c45d1fb Creates QuantConnect ApiPython project
This new project includes the source and tools to develop the quantconnect python package that provides interaction via API with quantconnect.com.
2018-02-09 15:06:36 +00:00
Jing Wu 785cb11f6f modified project file 2018-02-09 14:27:42 +00:00
Jing Wu 8c2e39db39 add python api 2018-02-09 14:27:42 +00:00
12112 921ec8f983 merge from upstream 2017-08-22 16:56:35 +01:00
Andrew de2fba28fd Store Api methods removed 2017-08-08 12:52:12 -04:00
Andrew e116709b24 Specify <LangVersion> of 6 in all csproj files 2017-08-07 15:27:26 -04:00