38 Commits

Author SHA1 Message Date
Jhonathan Abreu c565f4cfd0 Refactor optimization statistics serialization (#8984)
API Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* Refactor optimization result stats serialization

* Handle custom optimization statistics serialization

* Support custom statistics

* Support newest Lean statistics

Address peer review

* Add more tests

* Make indices reserved statistic names

* Minor fixes and cleanup
2025-12-22 17:08:24 -04:00
Martin-Molinero 3fef33fbf4 Rename Daily Performance Index Name (#7752) 2024-02-05 15:42:35 -03:00
Martin-Molinero 7705895cc6 Portfolio margin chart (#7719)
API Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* Portfolio state chart

- Cleanup and renames
- Add series.IndexName. Uodating unit tests
- Add Chart.LegendDisabled. Adding new unit tests
- Add ChartPoint.Tooltip. Updating unit tests
- Minor compression tweak. Adding unit test
- Add ChartJsonConverter. Adding unit tests

* Minor chart serialization order tweak

* Refactor portfolio state sampling and storing

* Move PortfolioMargin into a lean side chart
2024-02-01 12:43:08 -03:00
Martin-Molinero e0fdbb2618 Plotting Limits Handling Improvements (#7657)
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* Plotting Limits Handling Improvements

- Improve the handling and enforcement of plotting limits
- Increase local default limits

* Minor plotting test fix
2024-01-03 14:21:13 -03:00
Jhonathan Abreu 6109ac8f1b Candlestick charts (#7425)
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* Candlestick charts base implementation

* Series and Candlestick series json serialization

* Some cleanup

* Add AddPlot method for candlestick series to QCAlgorithm

* Remove Values property from ISeriesPoint

* Add candlestick QCAlgorithm.Plot trade bar methods

* Implement candlestick series re-sampling

* Add more SeriesSampler unit tests

* Add examples of candlestick charts usage to exisiting charting algorithm

* Address peer review

* Address peer review

* Derive Candlestick from Bar

* Sampler changes

* Add new series types from the cloud

* Add more candlestick series sampler tests

* Minor cleanup

* Minor changes
2023-08-08 17:52:46 -03:00
Jhonathan Abreu 5d6110f38c Make summary statistics available to algorithms at runtime (#7320)
* Make statistics available at runtime to algorithms

* Re-calculate statistics on every call

* Housekeeping

* Add regression algorithms

* Address peer review

* Support for custom summary statistics at runtime

* Minor changes

* Address peer review

* Address peer review

* Minor changes

* Minor changes
2023-06-19 17:34:59 -03:00
Martin-Molinero d1a2b95ddc Update reserved chart names (#7190) 2023-04-17 20:02:27 -03:00
Martin-Molinero 48914b08db Chart Series Settings Lost (#6997)
* Fix live trading chart series index

- Fix Series loosing their index when handled by the
  LiveTradingResultHandler
- Some clean up for Series.cs

* Fix SeriesSampler loosing Series settings
2023-02-21 13:07:56 -03:00
Jhonathan Abreu 94b9b13530 Make PlotIndicator able to receive IndicatorBase (#6745)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* Make PlotIndicator able to receive IndicatorBase

* Minor changes
2022-11-15 11:49:55 -03:00
Martin-Molinero 223066d6d9 Disable live trading warmup plotting (#6393)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
- Disable live trading warmup plotting during warmup
2022-06-09 17:27:55 -03:00
Ricardo Andrés Marino Rojas e78c3e1eb7 Solve bug when plotting Python indicators (#6347)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
* First commit

* Add unit test

* Change implementation

* Add unit tests

* Nit change

* nit change

* Remove unnecessary methods

* Add more unit tests

* Revert "Add more unit tests"

This reverts commit 1ba2ab7454efafba7c38034a15df3f8e97bc7146.

* Add more unit tests

* Add more unit tests

* Improve Implementation

* Change unit tests

* Remove unit tests

Remove unit tests from AlgorithmRegisterIndicatorTests.cs
2022-05-26 13:03:42 -03:00
Louis Szeto 8ca9258e70 API Reference for docs v2 (#6098)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
API Reference for docs v2 

Co-authored-by: Alexandre Catarino <AlexCatarino@users.noreply.github.com>
2021-12-08 16:25:36 -08:00
Colton Sellers f47775338c Expand Lean Default Charts and Reduce Clutter (#5680)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* Update charts that are not empty and not default values

* Testing

* Filter final results

* Explicitly filter alpha charts if not needed

* Use filtered charts for Live results handler

* Refactor solution to manage alpha charts internally by creator

* nit comment fixes

* Implement drawdown as default chart

* Implement Capacity Estimate for backtest default chart

* Add default values to QC.Plotting

* Adjust drawdown calculation

* Only sample "Capacity" once a day

* Implement Volume chart

* Nit fixes

* Volume Chart adjustments and fixes

* Rename to "Assets Sales Volume"

* Implement Exposure Sampling

* Store algorithm currency symbol, round capacity to nearest 1k

* Add new plots to default charts

* nit change name

* Address reviews

* Reduce duplication and clean up exposure sampling

* Address reviews

* Improve sample exposure

* Address review

* Only enumerate holdings once

* nit - comments

* Post rebase fix

* Don't need to round anymore
2021-06-22 11:19:48 -03:00
adam-may 03efc1b735 Remove internal usages of implicit operator in Indicator code (#4844)
* Convert usages of implicit operator in IndicatorBase and IndicatorDataPoint

* Reverting changes to example code
2020-10-12 10:31:05 -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
Martin Molinero e294b3c3e2 Fix overflow exception
- Adding new `AlgorithmSettings` Min and Max absolute portfolio target
percentage
- Adding new `PortfolioConstructionModel.FilterInvalidInsightMagnitude()`
helper method that will be used by the `BlackLitterman` and
`MeanVariance` optiomization portfolio construction models to skip
insights with extreme magnitudes that will cause exceptions
- `PortfolioTarget.Percentage()` will now verify requested percent is
withing the settings values
2019-05-23 20:30:44 -03:00
Martin Molinero b7930aff67 Performance improvements
- Using `Aggregate(lambda)` vs `Sum(lambda)` since the later is slower
due to performing an extra `Select`
- For `QCAlgorithm.Framework.OnFrameworkData()` will avoid calling
`ToArray()` on empty `Enumerables` due to its cost * the number of
calls. If the `Enumerable` is the empty instance, which is static,
will create a new empty array and return it instead.
- Replacing `SecurityIdentifier` `SecurityType` and `GetHashCode`
implementations for `Lazy` versions, that are performed just once, since
these values do not change and are used multiple times.
- For the different `DataDictionary<T>` implementations adding `this[
Symbol] get; set` since existing overload `this [string]` produces an
extra round operations `Symbol->string->Symbol` with a significant
impact.
- Adding `PortfolioTargetCollection.AddRange()` overload using an array
to avoid unnecessary convertions.
2019-04-11 19:01:27 -03:00
Martin Molinero 17995f4c86 Adding a configuration for maximum data points per chart series. Limit will only apply for backtesting result handler 2018-08-17 18:14:33 -03:00
Stefano Raggi 3fecc1b585 Remove ContainsKey checks before TryAdd in QCAlgorithm.Plotting
ConcurrentDictionary.TryAdd will return false and do nothing if the key already exists.
2018-03-07 16:45:11 +01:00
Stefano Raggi 7460d4f9c7 Fix concurrency issue in QCAlgorithm charts
Fixes #1640
2018-03-07 15:09:48 +01:00
Stefano Raggi 1db28b8358 Fix reserved chart names error in AddPlot
Fixes #1435
2018-01-04 23:59:43 +01:00
Michael Handschuh 2bc7905ea2 Add signal count and signal asset breakdown charts
Modifies the way we sample charts to be more like the equity sampling that we do.
In this case, we compute a sampling period based off of 1000 samples for the entire
backtest. In live mode, we'll just sample each minute.
2017-12-15 16:01:09 -05:00
Michael Handschuh 205b1cde3c Add QCAlgorithm.AddSeries method
Adding a scatter plot is an involved process because there's not
direct and easy way to just define a series object. This change
allows an algorithm to simply define the series without pumping
any data into it. This allows the user to set the series type and
the unit for the series
2017-10-27 00:04:03 -04:00
AlexCatarino c01470e1db Fixes PlotIndicator for python algorithms
Available PlotIndicator method overloads did not cover all the possibilities, so we now use PyObject as a pseudo-generic.
2017-10-24 20:24:52 +01:00
Stefano Raggi e7172a6841 Update QCAlgorithm.RuntimeStatistics to be a ConcurrentDictionary
This change enables SetRuntimeStatistics to be called from event handlers fired by other threads (for example in the OnOrderEvent with IB)
2017-07-20 20:39:51 +02:00
jaredbroad a2d822ea95 Set default plotting time to UTC 2017-02-15 13:03:33 -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
QuantConnect 2d9f8cb9e3 Updated charting lib to use series indexes instead of chart types. Obsolete ChartType enum 2015-12-10 13:03:50 -05:00
snugs e1938baafe Clean up using directives 2015-09-01 22:17:35 -04:00
snugs 82b2b7c2d7 Optionally wait for indicator to be ready before plotting 2015-06-22 17:28:18 -04:00
snugs 1cc048e481 Make PlotIndicator more generic 2015-06-22 15:02:41 -04:00
QuantConnect fde0cbed3a Strip out block quote section header comments 2015-06-13 16:04:27 -04:00
snugs 89b6e98af8 Fixes warnings mostly relating to xml comments
Also cleans up some block comments

Via PR#72 - thanks @ammachado!
2015-05-13 10:56:47 -04:00
snugs ffd7d99aa3 Adds Field.cs static class for indicator selectors
Adds PlotIndicator which wires up event to plot on new values
2015-05-11 21:33:30 -04:00
snugs e346eaad76 Add purge method to Series 2015-05-04 21:33:29 -04:00
snugs d80b1733a9 Pre ib launch review 2015-04-24 19:12:16 -04:00
Jared Broad ad9e153bb7 Added meta to list of reserved chart names 2015-02-11 21:22:13 -03:00
Jared Broad b3de520915 Initial commit 2015-01-12 12:03:33 -03:00