AI Slop Code RIsk Monitor

QuantConnect/Lean

Lean Algorithmic Trading Engine by QuantConnect (Python, C#)

9.1 Moderate pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for QuantConnect/Lean, a C# project with 21,955 GitHub stars. SynthScan examined 858,220 lines of code across 5062 source files, recording 6399 pattern matches distributed across 22 syntactic categories. The legacy adjusted pattern signal is 9.1 (Moderate pattern signal); it is not an authorship estimate.

Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.

9.1
Adjusted Signal
9.1
Raw Pattern Score
100%
Time Factor
2026-10-09
Last Push
22.0K
Stars
C#
Language
858.2K
Lines of Code
5.1K
Files
6.4K
Pattern Hits
2026-10-12
Scan Date
0.05
HC Hit Rate

Risk Review · v3

Use each vector to guide manual verification of the underlying findings.

Cognitive Ownership Risk 28.9/100 · MEDIUM

Can maintainers explain intent, assumptions, and trade-offs? 5489 finding(s).

Hallucinated Dependency & Supply Chain Risk 4.4/100 · LOW

Are imports declared and package/API names verified? 656 finding(s).

Agent Over-Engineering Ratio 8.0/100 · LOW

Are wrappers, guards, and repeated structures necessary? 467 finding(s).

PR Review Velocity Impact 38.2/100 · MEDIUM

Which changes need focused human review? 6399 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.

Severity Breakdown

Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.

CRITICAL 14HIGH 239MEDIUM 267LOW 5879

Directory Score Breakdown

This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.

Pattern Findings

The scanner identified 6399 distinct pattern matches across 22 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.

Over-Commented Block4942 hits · 4616 pts
SeverityFileLineSnippetContext
LOWResearch/QuantBook.cs341 };COMMENT
LOWResearch/QuantBook.cs361COMMENT
LOWResearch/QuantBook.cs461 // the symbol is a contractCOMMENT
LOWResearch/QuantBook.cs521 }COMMENT
LOWResearch/QuantBook.cs541 /// Gets the historical data of an indicator for the specified symbol. The exact number of bars will be returnedCOMMENT
LOWResearch/QuantBook.cs561 /// <param name="periods">The number of bars to request</param>COMMENT
LOWResearch/QuantBook.cs621COMMENT
LOWResearch/QuantBook.cs641 /// The symbol must exist in the Securities collection.COMMENT
LOWResearch/QuantBook.cs661 /// <param name="indicator">Indicator</param>COMMENT
LOWResearch/QuantBook.cs681 /// <param name="start">The start time in the algorithm's time zone</param>COMMENT
LOWResearch/QuantBook.cs741 /// </summary>COMMENT
LOWResearch/start.py1# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.COMMENT
LOW…erDataProvider/DownloaderDataProviderArgumentParser.cs41 /// <summary>COMMENT
LOWDownloaderDataProvider/Program.cs41 /// </summary>COMMENT
LOWDownloaderDataProvider/Program.cs201 }COMMENT
LOWDownloaderDataProvider/Models/DataDownloadConfig.cs41COMMENT
LOWDownloaderDataProvider/Models/BaseDataDownloadConfig.cs41 /// <summary>COMMENT
LOWConfiguration/Config.cs201 /// Get the int value of a config string.COMMENT
LOWConfiguration/Config.cs301 /// <summary>COMMENT
LOW…Framework/Execution/StandardDeviationExecutionModel.cs41 /// Gets or sets the maximum order value in units of the account currency.COMMENT
LOW…Framework/Execution/StandardDeviationExecutionModel.cs181 {COMMENT
LOW…Framework/Execution/StandardDeviationExecutionModel.py1# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.COMMENT
LOW…/Execution/VolumeWeightedAveragePriceExecutionModel.cs41 /// </summary>COMMENT
LOWAlgorithm.Framework/Execution/SpreadExecutionModel.py1# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.COMMENT
LOW…/Execution/VolumeWeightedAveragePriceExecutionModel.py1# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.COMMENT
LOW…work/Portfolio/MaximumSharpeRatioPortfolioOptimizer.py1# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.COMMENT
LOW…k/Portfolio/MeanReversionPortfolioConstructionModel.cs81 /// </summary>COMMENT
LOW…/MeanVarianceOptimizationPortfolioConstructionModel.cs41 private readonly IPortfolioOptimizer _optimizer;COMMENT
LOW…/MeanVarianceOptimizationPortfolioConstructionModel.cs101 Resolution resolution = Resolution.Daily,COMMENT
LOW…/MeanVarianceOptimizationPortfolioConstructionModel.cs141 elseCOMMENT
LOW…work/Portfolio/MaximumSharpeRatioPortfolioOptimizer.cs21COMMENT
LOW…k/Portfolio/MeanReversionPortfolioConstructionModel.py1# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.COMMENT
LOW…/MeanVarianceOptimizationPortfolioConstructionModel.py1# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.COMMENT
LOW…hm.Framework/Portfolio/RiskParityPortfolioOptimizer.py1# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.COMMENT
LOW…amework/Portfolio/MinimumVariancePortfolioOptimizer.py1# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.COMMENT
LOW…work/Portfolio/RiskParityPortfolioConstructionModel.py1# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.COMMENT
LOW…Framework/Portfolio/PortfolioOptimizerPythonWrapper.cs21{COMMENT
LOW…/Portfolio/EqualWeightingPortfolioConstructionModel.py1# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.COMMENT
LOW…Portfolio/SectorWeightingPortfolioConstructionModel.cs41 /// <summary>COMMENT
LOW…Portfolio/SectorWeightingPortfolioConstructionModel.cs61COMMENT
LOW…ortfolio/InsightWeightingPortfolioConstructionModel.cs21using QuantConnect.Scheduling;COMMENT
LOW…ortfolio/InsightWeightingPortfolioConstructionModel.cs41 /// in UTC</param>COMMENT
LOW…ortfolio/InsightWeightingPortfolioConstructionModel.cs101COMMENT
LOW…lackLittermanOptimizationPortfolioConstructionModel.cs101 /// <summary>COMMENT
LOW…lackLittermanOptimizationPortfolioConstructionModel.cs161 /// <summary>COMMENT
LOW…rk/Portfolio/AlphaStreamsPortfolioConstructionModel.cs21{COMMENT
LOW…folio/AccumulativeInsightPortfolioConstructionModel.py1# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.COMMENT
LOW…tfolio/ConfidenceWeightedPortfolioConstructionModel.py1# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.COMMENT
LOW…hm.Framework/Portfolio/RiskParityPortfolioOptimizer.cs41 }COMMENT
LOW…hm.Framework/Portfolio/RiskParityPortfolioOptimizer.cs61 var solution = RiskParityNewtonMethodOptimization(size, covariance, expectedReturns);COMMENT
LOW…rtfolio/UnconstrainedMeanVariancePortfolioOptimizer.py1# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.COMMENT
LOW…amework/Portfolio/MinimumVariancePortfolioOptimizer.cs21COMMENT
LOW…work/Portfolio/RiskParityPortfolioConstructionModel.cs101 /// </summary>COMMENT
LOW…work/Portfolio/RiskParityPortfolioConstructionModel.cs141 : this(rebalancingFunc != null ? (Func<DateTime, DateTime?>)(timeUtc => rebalancingFunc(timeUtc)) : null,COMMENT
LOW…Portfolio/SectorWeightingPortfolioConstructionModel.py1# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.COMMENT
LOW…/Portfolio/EqualWeightingPortfolioConstructionModel.cs21using QuantConnect.Scheduling;COMMENT
LOW…/Portfolio/EqualWeightingPortfolioConstructionModel.cs61 /// <summary>COMMENT
LOW…ortfolio/InsightWeightingPortfolioConstructionModel.py1# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.COMMENT
LOW…folio/AccumulativeInsightPortfolioConstructionModel.cs21using QuantConnect.Scheduling;COMMENT
LOW…folio/AccumulativeInsightPortfolioConstructionModel.cs41COMMENT
4882 more matches not shown…
Cross-File Repetition222 hits · 1110 pts
SeverityFileLineSnippetContext
HIGH…Framework/Execution/StandardDeviationExecutionModel.py0event fired each time the we add/remove securities from the data feed. args: algorithm: the algorithm instance that expeSTRING
HIGH…/Execution/VolumeWeightedAveragePriceExecutionModel.py0event fired each time the we add/remove securities from the data feed. args: algorithm: the algorithm instance that expeSTRING
HIGH…k/Portfolio/MeanReversionPortfolioConstructionModel.py0event fired each time the we add/remove securities from the data feed. args: algorithm: the algorithm instance that expeSTRING
HIGH…/MeanVarianceOptimizationPortfolioConstructionModel.py0event fired each time the we add/remove securities from the data feed. args: algorithm: the algorithm instance that expeSTRING
HIGH…work/Portfolio/RiskParityPortfolioConstructionModel.py0event fired each time the we add/remove securities from the data feed. args: algorithm: the algorithm instance that expeSTRING
HIGH…Portfolio/SectorWeightingPortfolioConstructionModel.py0event fired each time the we add/remove securities from the data feed. args: algorithm: the algorithm instance that expeSTRING
HIGH…lackLittermanOptimizationPortfolioConstructionModel.py0event fired each time the we add/remove securities from the data feed. args: algorithm: the algorithm instance that expeSTRING
HIGH…orithm.Framework/Alphas/HistoricalReturnsAlphaModel.py0event fired each time the we add/remove securities from the data feed. args: algorithm: the algorithm instance that expeSTRING
HIGHAlgorithm.Framework/Alphas/EmaCrossAlphaModel.py0event fired each time the we add/remove securities from the data feed. args: algorithm: the algorithm instance that expeSTRING
HIGHAlgorithm.Framework/Alphas/ConstantAlphaModel.py0event fired each time the we add/remove securities from the data feed. args: algorithm: the algorithm instance that expeSTRING
HIGH…ework/Risk/MaximumSectorExposureRiskManagementModel.py0event fired each time the we add/remove securities from the data feed. args: algorithm: the algorithm instance that expeSTRING
HIGH….Python/Alphas/GasAndCrudeOilEnergyCorrelationAlpha.py0event fired each time the we add/remove securities from the data feed. args: algorithm: the algorithm instance that expeSTRING
HIGH…ork/Alphas/PearsonCorrelationPairsTradingAlphaModel.py0event fired each time the we add/remove securities from the data feed. args: algorithm: the algorithm instance that expeSTRING
HIGH…gorithm.Framework/Alphas/BasePairsTradingAlphaModel.py0event fired each time the we add/remove securities from the data feed. args: algorithm: the algorithm instance that expeSTRING
HIGH…/MeanVarianceOptimizationPortfolioConstructionModel.py0contains data specific to a symbol required by this modelSTRING
HIGH…work/Portfolio/RiskParityPortfolioConstructionModel.py0contains data specific to a symbol required by this modelSTRING
HIGH…lackLittermanOptimizationPortfolioConstructionModel.py0contains data specific to a symbol required by this modelSTRING
HIGH…orithm.Framework/Alphas/HistoricalReturnsAlphaModel.py0contains data specific to a symbol required by this modelSTRING
HIGHAlgorithm.Framework/Alphas/EmaCrossAlphaModel.py0contains data specific to a symbol required by this modelSTRING
HIGHAlgorithm.Framework/Alphas/RsiAlphaModel.py0contains data specific to a symbol required by this modelSTRING
HIGHAlgorithm.Python/Alphas/GreenblattMagicFormulaAlpha.py0contains data specific to a symbol required by this modelSTRING
HIGHAlgorithm.Python/Alphas/VIXDualThrustAlpha.py0contains data specific to a symbol required by this modelSTRING
HIGH….Python/Alphas/GasAndCrudeOilEnergyCorrelationAlpha.py0contains data specific to a symbol required by this modelSTRING
HIGH…/Portfolio/EqualWeightingPortfolioConstructionModel.py0initialize a new instance of insightweightingportfolioconstructionmodel args: rebalance: rebalancing parameter. if it isSTRING
HIGH…folio/AccumulativeInsightPortfolioConstructionModel.py0initialize a new instance of insightweightingportfolioconstructionmodel args: rebalance: rebalancing parameter. if it isSTRING
HIGH…tfolio/ConfidenceWeightedPortfolioConstructionModel.py0initialize a new instance of insightweightingportfolioconstructionmodel args: rebalance: rebalancing parameter. if it isSTRING
HIGH…Portfolio/SectorWeightingPortfolioConstructionModel.py0initialize a new instance of insightweightingportfolioconstructionmodel args: rebalance: rebalancing parameter. if it isSTRING
HIGH…ortfolio/InsightWeightingPortfolioConstructionModel.py0initialize a new instance of insightweightingportfolioconstructionmodel args: rebalance: rebalancing parameter. if it isSTRING
HIGH…/Portfolio/EqualWeightingPortfolioConstructionModel.py0will determine the target percent for each insight args: active_insights: the active insights to generate a target forSTRING
HIGH…folio/AccumulativeInsightPortfolioConstructionModel.py0will determine the target percent for each insight args: active_insights: the active insights to generate a target forSTRING
HIGH…Portfolio/SectorWeightingPortfolioConstructionModel.py0will determine the target percent for each insight args: active_insights: the active insights to generate a target forSTRING
HIGH…ortfolio/InsightWeightingPortfolioConstructionModel.py0will determine the target percent for each insight args: active_insights: the active insights to generate a target forSTRING
HIGH…tfolio/ConfidenceWeightedPortfolioConstructionModel.py0method that will determine if the portfolio construction model should create a target for this insight args: insight: thSTRING
HIGH…Portfolio/SectorWeightingPortfolioConstructionModel.py0method that will determine if the portfolio construction model should create a target for this insight args: insight: thSTRING
HIGH…ortfolio/InsightWeightingPortfolioConstructionModel.py0method that will determine if the portfolio construction model should create a target for this insight args: insight: thSTRING
HIGH…orithm.Framework/Alphas/HistoricalReturnsAlphaModel.py0updates this alpha model with the latest data from the algorithm. this is called each time the algorithm receives data fSTRING
HIGH…gorithm.Framework/Alphas/BasePairsTradingAlphaModel.py0updates this alpha model with the latest data from the algorithm. this is called each time the algorithm receives data fSTRING
HIGHAlgorithm.Framework/Alphas/EmaCrossAlphaModel.py0updates this alpha model with the latest data from the algorithm. this is called each time the algorithm receives data fSTRING
HIGHAlgorithm.Framework/Alphas/RsiAlphaModel.py0updates this alpha model with the latest data from the algorithm. this is called each time the algorithm receives data fSTRING
HIGH…phas/ContingentClaimsAnalysisDefaultPredictionAlpha.py0updates this alpha model with the latest data from the algorithm. this is called each time the algorithm receives data fSTRING
HIGH…amework/Selection/FundamentalUniverseSelectionModel.py0creates a new fundamental universe using this class's selection functions args: algorithm: the algorithm instance to creSTRING
HIGH…hm.Framework/Selection/OptionUniverseSelectionModel.py0creates a new fundamental universe using this class's selection functions args: algorithm: the algorithm instance to creSTRING
HIGH…hm.Framework/Selection/FutureUniverseSelectionModel.py0creates a new fundamental universe using this class's selection functions args: algorithm: the algorithm instance to creSTRING
HIGH…hm.Framework/Selection/OptionUniverseSelectionModel.py0gets the next time the framework should invoke the `createuniverses` method to refresh the set of universes.STRING
HIGH…hm.Framework/Selection/FutureUniverseSelectionModel.py0gets the next time the framework should invoke the `createuniverses` method to refresh the set of universes.STRING
HIGHAlgorithm/Selection/UniverseSelectionModel.py0gets the next time the framework should invoke the `createuniverses` method to refresh the set of universes.STRING
HIGH…ithm.Framework/Risk/MaximumDrawdownPercentPortfolio.py0manages the algorithm's risk at each time step args: algorithm: the algorithm instance targets: the current portfolio taSTRING
HIGH…ithm.Framework/Risk/TrailingStopRiskManagementModel.py0manages the algorithm's risk at each time step args: algorithm: the algorithm instance targets: the current portfolio taSTRING
HIGH…work/Risk/MaximumUnrealizedProfitPercentPerSecurity.py0manages the algorithm's risk at each time step args: algorithm: the algorithm instance targets: the current portfolio taSTRING
HIGH…hm.Framework/Risk/MaximumDrawdownPercentPerSecurity.py0manages the algorithm's risk at each time step args: algorithm: the algorithm instance targets: the current portfolio taSTRING
HIGHAlgorithm/Risk/CompositeRiskManagementModel.py0manages the algorithm's risk at each time step args: algorithm: the algorithm instance targets: the current portfolio taSTRING
HIGH…hm.Python/NumeraiSignalExportDemonstrationAlgorithm.py0initialize the date and add all equity symbols present in list _symbolsSTRING
HIGH…lective2PortfolioSignalExportDemonstrationAlgorithm.py0initialize the date and add all equity symbols present in list _symbolsSTRING
HIGH…ython/Collective2SignalExportDemonstrationAlgorithm.py0initialize the date and add all equity symbols present in list _symbolsSTRING
HIGH…thm.Python/CustomSignalExportDemonstrationAlgorithm.py0initialize the date and add all equity symbols present in list _symbolsSTRING
HIGHAlgorithm.Python/ConstituentsQC500GeneratorAlgorithm.py0initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. all algorithms STRING
HIGHAlgorithm.Python/UpdateOrderRegressionAlgorithm.py0initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. all algorithms STRING
HIGH…on/AddOptionContractFromUniverseRegressionAlgorithm.py0initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. all algorithms STRING
HIGHAlgorithm.Python/BasicTemplateCfdAlgorithm.py0initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. all algorithms STRING
HIGH…on/CoarseFineOptionUniverseChainRegressionAlgorithm.py0initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. all algorithms STRING
162 more matches not shown…
AI Slop Vocabulary227 hits · 781 pts
SeverityFileLineSnippetContext
LOW…k/Portfolio/MeanReversionPortfolioConstructionModel.py73 # If we have no insights or non-ready just return an empty target listCOMMENT
LOW…/MeanVarianceOptimizationPortfolioConstructionModel.py85 # If we have no insights just return an empty target listCOMMENT
LOW…work/Portfolio/RiskParityPortfolioConstructionModel.py74 # If we have no insights just return an empty target listCOMMENT
MEDIUMAlgorithm.CSharp/MarginCallEventsAlgorithm.cs45 // cranking up the leverage increases the odds of a margin call when the security falls in valueCOMMENT
MEDIUM…orithm.CSharp/FractionalQuantityRegressionAlgorithm.cs47 // Since this test algorithm uses leverage we need to set a buying power model with margin.COMMENT
MEDIUM…Sharp/SetHoldingsMultipleTargetsRegressionAlgorithm.cs41 // use leverage 1 so we test the margin impact orderingCOMMENT
MEDIUM⚡…ithm.CSharp/NoMarginCallExpectedRegressionAlgorithm.cs54 // market leverage 10 minutes before market closes.COMMENT
MEDIUM⚡…ithm.CSharp/NoMarginCallExpectedRegressionAlgorithm.cs57 // before market close we reduce our position to closed market leverageCOMMENT
MEDIUM⚡…ithm.CSharp/NoMarginCallExpectedRegressionAlgorithm.cs66 // at market open we increase our position to open market leverageCOMMENT
MEDIUM…/CryptoFutureLeverageBasedMarginRegressionAlgorithm.cs26 /// changing leverage on a crypto futureCOMMENT
MEDIUM…/CryptoFutureLeverageBasedMarginRegressionAlgorithm.cs57 SetHoldings(_cryptoFuture.Symbol, 10); // Buy all we can with our margin (leverage is 10)CODE
MEDIUM…/CryptoFutureLeverageBasedMarginRegressionAlgorithm.cs87 SetHoldings(_cryptoFuture.Symbol, 20); // Buy all we can with our margin (new leverage is 20)CODE
MEDIUMAlgorithm.CSharp/CustomSecurityInitializerAlgorithm.cs72 /// so we can also take advantage of the default model/leverage settingCOMMENT
MEDIUM…hm.CSharp/MarginCallClosedMarketRegressionAlgorithm.cs76 // we should reduce our position by the same relation between the open and closed market leverageCOMMENT
MEDIUMAlgorithm.CSharp/OpeningBreakoutAlgorithm.cs121 // leverage tradier $1 tradersCOMMENT
MEDIUMAlgorithm.CSharp/OpeningBreakoutAlgorithm.cs130 // Set our max leverageCOMMENT
MEDIUMAlgorithm.CSharp/OpeningBreakoutAlgorithm.cs304 // min out at 1x leverageCOMMENT
MEDIUM…/ETFConstituentUniverseFrameworkRegressionAlgorithm.cs198 /// to the leverage of the ETF (1x, 2x, 3x, etc.)COMMENT
MEDIUM…p/Alphas/TripleLeveragedETFPairVolatilityDecayAlpha.cs29 /// Leveraged ETFs (LETF) promise a fixed leverage ratio with respect to an underlying asset or an index.COMMENT
MEDIUM…rithmFactory/Python/Wrappers/AlgorithmPythonWrapper.cs598 /// <param name="leverage">leverage for this security</param>COMMENT
MEDIUM…rithmFactory/Python/Wrappers/AlgorithmPythonWrapper.cs613 /// <param name="leverage">leverage for this security</param>COMMENT
MEDIUM…rithmFactory/Python/Wrappers/AlgorithmPythonWrapper.cs630 /// <param name="leverage">The requested leverage for this equity. Default is set by <see cref="SecurityInitialiCOMMENT
MEDIUM…rithmFactory/Python/Wrappers/AlgorithmPythonWrapper.cs643 /// <param name="leverage">The requested leverage for this equity. Default is set by <see cref="SecurityInitialiCOMMENT
MEDIUMIndicators/ConnorsRelativeStrengthIndex.cs25 /// This index is designed to provide a more robust measure of market strengthCOMMENT
LOWTests/Python/PythonPackagesTests.cs993 # specifying a single input parameter. In this example, we just pass the randomCOMMENT
MEDIUMTests/Algorithm/AlgorithmSetHoldingsTests.cs141 //Console.WriteLine("Leverage: " + leverage);COMMENT
MEDIUM…rities/PatternDayTradingMarginBuyingPowerModelTests.cs51 // No parameters initialization, used default PDT 4x leverage open market and 2x leverage otherwiseCOMMENT
MEDIUMTests/Common/Securities/SecurityMarginModelTests.cs65 // Initial and maintenance margin = (1000 * 20) / leverage = XCOMMENT
MEDIUMTests/Common/Securities/SecurityMarginModelTests.cs88 // Initial and maintenance margin = (1000 * 20) / leverage = XCOMMENT
MEDIUM…sts/Common/Securities/SecurityPortfolioManagerTests.cs356 // now the stock doubles, leverage is 1 we shouldn't have more margin remainingCOMMENT
MEDIUM…sts/Common/Securities/SecurityPortfolioManagerTests.cs372 // now the stock plummets, leverage is 1 we shouldn't have margin remainingCOMMENT
MEDIUM…sts/Common/Securities/SecurityPortfolioManagerTests.cs382 // this would not cause a margin call due to leverage = 1COMMENT
MEDIUM…Common/Securities/FutureMarginBuyingPowerModelTests.cs289 // we have a massive loss because of futures leverageCOMMENT
MEDIUM…Common/Securities/FutureMarginBuyingPowerModelTests.cs320 // we have a massive win because of futures leverageCOMMENT
MEDIUM…Common/Securities/OptionMarginBuyingPowerModelTests.cs45 // we test that options dont have leverage (100%) and it cannot be changedCOMMENT
MEDIUM⚡Tests/Common/Securities/MarginCallModelTests.cs202 // leverage is 1 we shouldn't have more margin remainingCOMMENT
MEDIUM⚡Tests/Common/Securities/MarginCallModelTests.cs212 // now the stock plummets, leverage is 1 we shouldn't have more margin remainingCOMMENT
MEDIUM⚡Tests/Common/Securities/MarginCallModelTests.cs222 // this would not cause a margin call due to leverage = 1COMMENT
MEDIUM⚡Tests/Common/Securities/MarginCallModelTests.cs228 // now change the leverage to test margin call warning and margin call logicCOMMENT
MEDIUM⚡Tests/Common/Securities/MarginCallModelTests.cs230 // simulate a loan - when we fill using leverage it will set a negative cash amountCOMMENT
MEDIUM…ecurities/CryptoFuture/CryptoFutureMarginModelTests.cs57 // ((quantity * contract mutiplier * price) / leverage) * conversion rate (BTC -> USD)COMMENT
MEDIUM…ecurities/CryptoFuture/CryptoFutureMarginModelTests.cs62 // ((quantity * contract mutiplier * price) / leverage) * conversion rate (USDT ~= USD)COMMENT
MEDIUMTests/Engine/Setup/BrokerageSetupHandlerTests.cs233 // Assert Leverage setting persisted for non options or futures (Blocked from setting leverage in SecuriCOMMENT
MEDIUMAlgorithm/QCAlgorithm.Trading.cs1423 /// if you have 2x leverage and request 100% holdings, it will utilize half of theCOMMENT
MEDIUMAlgorithm/QCAlgorithm.Python.cs107 /// <param name="leverage">Custom leverage per security</param>COMMENT
MEDIUMAlgorithm/QCAlgorithm.Python.cs127 /// <param name="leverage">Custom leverage per security</param>COMMENT
MEDIUMAlgorithm/QCAlgorithm.Python.cs151 /// <param name="leverage">Custom leverage per security</param>COMMENT
MEDIUMAlgorithm/QCAlgorithm.Python.cs190 /// <param name="leverage">Custom leverage per security</param>COMMENT
MEDIUMAlgorithm/QCAlgorithm.Python.cs216 /// <param name="leverage">Custom leverage per security</param>COMMENT
MEDIUMAlgorithm/QCAlgorithm.Python.cs261 /// <param name="leverage">Custom leverage per security</param>COMMENT
MEDIUMAlgorithm/QCAlgorithm.cs1434 // save the existing leverage specified in AddSecurity,COMMENT
MEDIUMAlgorithm/QCAlgorithm.cs1441 // restore the saved leverageCOMMENT
MEDIUMAlgorithm/QCAlgorithm.cs1959 /// <param name="leverage">Custom leverage per security</param>COMMENT
MEDIUMAlgorithm/QCAlgorithm.cs1963 /// <remarks> AddSecurity(SecurityType securityType, Symbol symbol, Resolution resolution, bool fillForward, decCOMMENT
MEDIUMAlgorithm/QCAlgorithm.cs1979 /// <param name="leverage">leverage for this security</param>COMMENT
MEDIUMAlgorithm/QCAlgorithm.cs2025 /// <param name="leverage">leverage for this security</param>COMMENT
MEDIUMAlgorithm/QCAlgorithm.cs2216 /// <param name="leverage">The requested leverage for this equity. Default is set by <see cref="SecurityInitialiCOMMENT
MEDIUMAlgorithm/QCAlgorithm.cs2234 /// <param name="leverage">The requested leverage for this equity. Default is set by <see cref="SecurityInitialiCOMMENT
MEDIUMAlgorithm/QCAlgorithm.cs2254 /// <param name="leverage">The requested leverage for the </param>COMMENT
MEDIUMAlgorithm/QCAlgorithm.cs2273 /// <param name="leverage">The requested leverage for the </param>COMMENT
167 more matches not shown…
Unused Imports637 hits · 612 pts
SeverityFileLineSnippetContext
LOWResearch/start.py30CODE
LOW…Framework/Execution/StandardDeviationExecutionModel.py14CODE
LOWAlgorithm.Framework/Execution/SpreadExecutionModel.py14CODE
LOW…/Execution/VolumeWeightedAveragePriceExecutionModel.py14CODE
LOW…work/Portfolio/MaximumSharpeRatioPortfolioOptimizer.py14CODE
LOW…k/Portfolio/MeanReversionPortfolioConstructionModel.py14CODE
LOW…/MeanVarianceOptimizationPortfolioConstructionModel.py14CODE
LOW…hm.Framework/Portfolio/RiskParityPortfolioOptimizer.py14CODE
LOW…hm.Framework/Portfolio/RiskParityPortfolioOptimizer.py15CODE
LOW…amework/Portfolio/MinimumVariancePortfolioOptimizer.py14CODE
LOW…work/Portfolio/RiskParityPortfolioConstructionModel.py14CODE
LOW…/Portfolio/EqualWeightingPortfolioConstructionModel.py14CODE
LOW…folio/AccumulativeInsightPortfolioConstructionModel.py14CODE
LOW…tfolio/ConfidenceWeightedPortfolioConstructionModel.py14CODE
LOW…Portfolio/SectorWeightingPortfolioConstructionModel.py14CODE
LOW…ortfolio/InsightWeightingPortfolioConstructionModel.py14CODE
LOW…lackLittermanOptimizationPortfolioConstructionModel.py14CODE
LOW…lackLittermanOptimizationPortfolioConstructionModel.py17CODE
LOW…orithm.Framework/Alphas/HistoricalReturnsAlphaModel.py14CODE
LOW…ork/Alphas/PearsonCorrelationPairsTradingAlphaModel.py14CODE
LOWAlgorithm.Framework/Alphas/MacdAlphaModel.py14CODE
LOW…gorithm.Framework/Alphas/BasePairsTradingAlphaModel.py14CODE
LOWAlgorithm.Framework/Alphas/EmaCrossAlphaModel.py14CODE
LOWAlgorithm.Framework/Alphas/RsiAlphaModel.py14CODE
LOWAlgorithm.Framework/Alphas/RsiAlphaModel.py15CODE
LOWAlgorithm.Framework/Alphas/ConstantAlphaModel.py14CODE
LOW…ork/Selection/ETFConstituentsUniverseSelectionModel.py14CODE
LOW…thm.Framework/Selection/QC500UniverseSelectionModel.py14CODE
LOW…amework/Selection/FundamentalUniverseSelectionModel.py14CODE
LOW…hm.Framework/Selection/OptionUniverseSelectionModel.py14CODE
LOW….Framework/Selection/EmaCrossUniverseSelectionModel.py14CODE
LOW…hm.Framework/Selection/FutureUniverseSelectionModel.py14CODE
LOW…ework/Risk/MaximumSectorExposureRiskManagementModel.py14CODE
LOW…ithm.Framework/Risk/MaximumDrawdownPercentPortfolio.py14CODE
LOW…ithm.Framework/Risk/TrailingStopRiskManagementModel.py14CODE
LOW…work/Risk/MaximumUnrealizedProfitPercentPerSecurity.py14CODE
LOW…hm.Framework/Risk/MaximumDrawdownPercentPerSecurity.py14CODE
LOW…/Research/RegressionScripts/Test_QuantBookIndicator.py14CODE
LOW…ts/Research/RegressionScripts/Test_QuantBookHistory.py14CODE
LOW…ts/Research/RegressionScripts/Test_QuantBookHistory.py16CODE
LOWTests/Research/RegressionScripts/custom_data.py14CODE
LOWTests/TestData/generate_reference_data_from_talipp.py4CODE
LOWTests/Python/PandasTests/PandasIndexingTests.py14CODE
LOWTests/Python/PandasTests/PandasIndexingTests.py15CODE
LOWTests/Python/PandasTests/PandasIndexingTests.py16CODE
LOWTests/Python/PandasTests/PandasMapperTests.py48CODE
LOWTests/Python/PandasTests/PandasMapperTests.py54CODE
LOW…ts/RegressionAlgorithms/Test_AlgorithmPythonWrapper.py14CODE
LOW…egressionAlgorithms/Test_PythonExceptionInterpreter.py14CODE
LOW…egressionAlgorithms/Test_PythonExceptionInterpreter.py59CODE
LOWTests/RegressionAlgorithms/Test_MethodOverload.py14CODE
LOWTests/RegressionAlgorithms/Test_CustomDataAlgorithm.py14CODE
LOWTests/RegressionAlgorithms/Test_CustomDataAlgorithm.py16CODE
LOWAlgorithm/Execution/ImmediateExecutionModel.py14CODE
LOWAlgorithm/Execution/NullExecutionModel.py14CODE
LOWAlgorithm/Portfolio/NullPortfolioConstructionModel.py14CODE
LOWAlgorithm/Alphas/NullAlphaModel.py14CODE
LOWAlgorithm/Selection/UniverseSelectionModel.py14CODE
LOWAlgorithm/Selection/ManualUniverseSelectionModel.py14CODE
LOWAlgorithm/Risk/NullRiskManagementModel.py14CODE
577 more matches not shown…
Hyper-Verbose Identifiers207 hits · 218 pts
SeverityFileLineSnippetContext
LOW…/Execution/VolumeWeightedAveragePriceExecutionModel.py146 def get_volume_and_average_price(self, input):CODE
LOW…/MeanVarianceOptimizationPortfolioConstructionModel.py65 def should_create_target_for_insight(self, insight):CODE
LOW…/MeanVarianceOptimizationPortfolioConstructionModel.py148 def on_rate_of_change_updated(self, roc, value):CODE
LOW…work/Portfolio/RiskParityPortfolioConstructionModel.py139 def on_rate_of_change_updated(self, roc, value):CODE
LOW…tfolio/ConfidenceWeightedPortfolioConstructionModel.py38 def should_create_target_for_insight(self, insight):CODE
LOW…Portfolio/SectorWeightingPortfolioConstructionModel.py37 def should_create_target_for_insight(self, insight):CODE
LOW…ortfolio/InsightWeightingPortfolioConstructionModel.py38 def should_create_target_for_insight(self, insight):CODE
LOW…lackLittermanOptimizationPortfolioConstructionModel.py80 def should_create_target_for_insight(self, insight):CODE
LOW…lackLittermanOptimizationPortfolioConstructionModel.py172 def apply_blacklitterman_master_formula(self, Pi, Sigma, P, Q):CODE
LOW…lackLittermanOptimizationPortfolioConstructionModel.py288 def on_rate_of_change_updated(self, roc, value):CODE
LOW…gorithm.Framework/Alphas/BasePairsTradingAlphaModel.py132 def create_identity_indicator(symbol: Symbol):CODE
LOW…amework/Selection/FundamentalUniverseSelectionModel.py61 def create_coarse_fundamental_universe(self, algorithm: QCAlgorithm) -> Universe:CODE
LOW…hm.Framework/Selection/OptionUniverseSelectionModel.py34 def get_next_refresh_time_utc(self):CODE
LOW…hm.Framework/Selection/FutureUniverseSelectionModel.py35 def get_next_refresh_time_utc(self):CODE
LOW…ithm.Framework/Risk/MaximumDrawdownPercentPortfolio.py63 def get_total_drawdown_percent(self, current_value):CODE
LOW⚡…/Research/RegressionScripts/Test_QuantBookIndicator.py37 def test_bollinger_bands_backwards_compatibility(self, symbol, start, end, resolution):CODE
LOW⚡…/Research/RegressionScripts/Test_QuantBookIndicator.py41 def test_average_true_range_backwards_compatibility(self, symbol, start, end, resolution):CODE
LOW⚡…/Research/RegressionScripts/Test_QuantBookIndicator.py45 def test_on_balance_volume_backwards_compatibility(self, symbol, start, end, resolution):CODE
LOWTests/TestData/generate_reference_data_from_talib.py24def generate_reference_data_for_single_output_indicator(CODE
LOWTests/TestData/generate_reference_data_from_talib.py36def generate_reference_data_for_multi_output_indicator(CODE
LOWTests/TestData/generate_reference_data_from_talipp.py20 def generate_reference_data_for_siso_indicator(CODE
LOWTests/TestData/generate_reference_data_from_talipp.py30 def generate_reference_data_for_miso_indicator(CODE
LOWTests/TestData/generate_reference_data_from_talipp.py49 def generate_reference_data_for_simo_indicator(CODE
LOWTests/TestData/generate_reference_data_from_talipp.py69 def generate_reference_data_for_mimo_indicator(CODE
LOWTests/TestData/generate_reference_data_from_talipp.py98 def generate_reference_data_for_zigzag_indicator(CODE
LOWTests/TestData/generate_reference_data_from_tulip.py17def generate_reference_data_for_siso_indicator(CODE
LOW⚡Tests/Python/AlgorithmImportsTests.cs38def exception_is_the_python_builtin():CODE
LOW⚡Tests/Python/AlgorithmImportsTests.cs41def except_clause_catches_python_exceptions():CODE
LOW⚡Tests/Python/AlgorithmImportsTests.cs49def except_clause_catches_clr_exceptions(action):CODE
LOWTests/Python/BasePythonWrapperTests.cs123 def set_return_valid_out_param_type(self, value):CODE
LOWTests/Python/BasePythonWrapperTests.cs157 def set_return_valid_out_params_count(self, value):CODE
LOWTests/Python/BasePythonWrapperTests.cs188 def set_use_valid_return_type(self, value):CODE
LOWTests/Python/BasePythonWrapperTests.cs219 def set_use_valid_return_type(self, value):CODE
LOWTests/Python/BasePythonWrapperTests.cs284 def set_use_valid_return_type(self, value):CODE
LOWTests/Python/BasePythonWrapperTests.cs350 def set_use_valid_return_type(self, value):CODE
LOWTests/Python/PandasTests/PandasIndexingTests.py27 def test_indexing_dataframe_with_list(self):CODE
LOWTests/Python/PandasTests/PandasIndexingTests.py49 def test_contains_user_mapped_ticker(self):CODE
LOWTests/Python/PandasTests/PandasIndexingTests.py62 def test_contains_user_defined_columns_with_spaces(self, column_name):CODE
LOWTests/Python/PandasTests/PandasIndexingTests.py73 def test_column_equals_only_matching_string(self):CODE
LOWTests/Indicators/OptionBaseIndicatorTests.cs422def get_option_indicator_base_indicator(symbol: Symbol) -> OptionIndicatorBase:CODE
LOWTests/Indicators/RollingWindowTests.cs550def rolling_window_with_tuple():CODE
LOW⚡Tests/Indicators/RollingWindowTests.cs570def rolling_window_with_float():CODE
LOW⚡Tests/Indicators/RollingWindowTests.cs577def rolling_window_with_trade_bar():CODE
LOW⚡Tests/Indicators/RollingWindowTests.cs584def rolling_window_with_quote_bar():CODE
LOW⚡Tests/Indicators/RollingWindowTests.cs591def rolling_window_with_custom_data_type():CODE
LOWTests/Indicators/CompositeIndicatorTests.cs114def create_composite_indicator(left, right, operation):CODE
LOWTests/Algorithm/AlgorithmAddSecurityTests.cs479def add_security_initializers(algorithm):CODE
LOWTests/Algorithm/AlgorithmAddSecurityTests.cs614def add_security_initializers(algorithm):CODE
LOWTests/Algorithm/AlgorithmAddSecurityTests.cs703def add_security_initializers(algorithm):CODE
LOWTests/Algorithm/AlgorithmIndicatorsTests.cs756def create_intraday_vwap_indicator(name):CODE
LOW…thm/Framework/FrameworkModelsPythonInheritanceTests.cs136 def create_coarse_fundamental_universe(self, algorithm):CODE
LOWTests/Common/Securities/SecurityCacheTests.cs627def get_security_cache_margin_interest_rate():CODE
LOWTests/Common/Securities/SecurityCacheTests.cs633def get_security_cache_custom_data_type():CODE
LOWTests/Engine/DataFeeds/DataQueueHandlerManagerTests.cs214 private class TestDataHandler : IDataQueueHandlerCODE
LOWTests/Engine/DataFeeds/DataQueueHandlerManagerTests.cs241 private class ExplodingDataHandler : TestDataHandlerCODE
LOW…egressionAlgorithms/Test_PythonExceptionInterpreter.py28 def attribute_error_quote_bar_volume(self):CODE
LOW…egressionAlgorithms/Test_PythonExceptionInterpreter.py31 def attribute_error_trade_bar_ask_price(self):CODE
LOW…egressionAlgorithms/Test_PythonExceptionInterpreter.py49 def unsupported_operand_datetime_date(self):CODE
LOW…egressionAlgorithms/Test_PythonExceptionInterpreter.py52 def unsupported_operand_date_datetime(self):CODE
LOWTests/RegressionAlgorithms/Test_MethodOverload.py38 def call_plot_throw_managed_test(self):CODE
147 more matches not shown…
Hallucination Indicators14 hits · 140 pts
SeverityFileLineSnippetContext
CRITICALTests/Algorithm/AlgorithmHistoryTests.cs4661 Assert.That(historyResults, Has.All.Not.Empty.And.All.Count.EqualTo(expectedHistoryCount),CODE
CRITICALTests/Algorithm/AlgorithmAddUniverseTests.cs116 Assert.IsTrue(constituentUniverse.Configuration.Symbol.ID.Symbol.StartsWithInvariant("qc-universe-"));CODE
CRITICAL…election/ETFConstituentsUniverseSelectionModelTests.cs168 Assert.IsTrue(universe.Configuration.Symbol.ID.Symbol.StartsWithInvariant("qc-universe-"));CODE
CRITICALTests/Common/Util/PythonUtilTests.cs138 at QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.Initialize() in D:\QuantConnect\MyLean\Lean\ACODE
CRITICALTests/Common/Util/PythonUtilTests.cs155 at QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.Initialize() in D:\QuantConnect\MyLean\Lean\ACODE
CRITICALTests/Common/Util/PythonUtilTests.cs193 at QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.OnData(Slice slice) in /home/user/QuantConnecCODE
CRITICALTests/Common/Util/PythonUtilTests.cs208 at QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.OnData(Slice slice) in D:\QuantConnect\MyLeanCODE
CRITICALTests/Common/Util/PythonUtilTests.cs225 at QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.OnData(Slice slice) in C:\Users\user\QuantConCODE
CRITICALTests/Common/Data/SubscriptionManagerTests.cs176 var tickers = QuantConnect.Algorithm.CSharp.StressSymbols.StockSymbols.ToList();CODE
CRITICALTests/Common/Data/SubscriptionManagerTests.cs213 var tickers = QuantConnect.Algorithm.CSharp.StressSymbols.StockSymbols.Take(100).ToList();CODE
CRITICALTests/Engine/PerformanceBenchmarkAlgorithms.cs75 foreach (var symbol in QuantConnect.Algorithm.CSharp.Benchmarks.Symbols.Equity.All.Take(500))CODE
CRITICALTests/Engine/PerformanceBenchmarkAlgorithms.cs97 foreach (var symbol in QuantConnect.Algorithm.CSharp.Benchmarks.Symbols.Equity.All.Take(_parameters.SecuCODE
CRITICAL…andlerTests/ContingentOrdersTransactionHandlerTests.cs478 var bracket = QuantConnect.Tests.Common.Orders.ContingentOrderTests.CreateBracket();CODE
CRITICALTests/Engine/DataFeeds/FileSystemDataFeedTests.cs276 Assert.IsTrue(universeData.Any(kvp => kvp.Key.Configuration.Symbol.ID.Symbol.Contains("CONTINUOUCODE
Self-Referential Comments29 hits · 88 pts
SeverityFileLineSnippetContext
MEDIUM…/MeanVarianceOptimizationPortfolioConstructionModel.py91 # Create a dictionary keyed by the symbols in the insights with an pandas.series as value to create a data frameCOMMENT
MEDIUM…work/Portfolio/RiskParityPortfolioConstructionModel.py80 # Create a dictionary keyed by the symbols in the insights with an pandas.series as value to create a data frameCOMMENT
MEDIUM…lackLittermanOptimizationPortfolioConstructionModel.py91 # Create a dictionary keyed by the symbols in the insights with an pandas.Series as value to create a data fCOMMENT
MEDIUM…lackLittermanOptimizationPortfolioConstructionModel.py182 # Create the diagonal Sigma matrix of error terms from the expressed viewsCOMMENT
MEDIUM…rch/RegressionTemplates/BasicTemplateResearchPython.cs78 ", it is a datapoint indicator\", \"# Define the indicator\", \"bb = BollingerBands(30, 2)\", \"\",CODE
MEDIUM…es/BasicTemplateCustomDataTypeHistoryResearchPython.cs68 "tags\": [] }, \"outputs\": [], \"source\": [ \"# Create an instance\", \"qb = QuantBook()\", CODE
MEDIUMTests/Python/PythonPackagesTests.cs85 # Initialize dataframe object, specify time axis and variable namesCOMMENT
MEDIUMTests/Python/PythonPackagesTests.cs353 # Create a model (can be any object)COMMENT
MEDIUMTests/Python/PythonPackagesTests.cs487 # Define the models for the nuisance functionsCOMMENT
MEDIUMTests/Python/PythonPackagesTests.cs649 # Define the model hyperparametersCOMMENT
MEDIUMTests/Python/PythonPackagesTests.cs2012 # Create the linear solver with the GLOP backend.COMMENT
MEDIUMTests/Python/PythonPackagesTests.cs2015 # Create the variables x and y.COMMENT
MEDIUMTests/Python/PandasTests/PandasIndexingTests.py50 # Create a new DF that has a plain ticker, test that our mapper doesn't breakCOMMENT
MEDIUM…hm.Python/NumeraiSignalExportDemonstrationAlgorithm.py41 # Create a Scheduled Event to submit signals every trading day at 13:00 UTCCOMMENT
MEDIUM…reStopMarketOrderOnExtendedHoursRegressionAlgorithm.py35 # This method is opened 2 new orders by schedulerCOMMENT
MEDIUMAlgorithm.Python/CustomDataBitcoinAlgorithm.py31 # Define the symbol and "type" of our generic data:COMMENT
MEDIUMAlgorithm.Python/CustomPartialFillModelAlgorithm.py56 # Create the objectCOMMENT
MEDIUMAlgorithm.Python/MarginCallEventsAlgorithm.py59 # This method is called when portfolio.margin_remaining is under 5% of your portfolio.total_portfolio_valueCOMMENT
MEDIUM…rithm.Python/CustomDataIndicatorExtensionsAlgorithm.py40 # Define the symbol and "type" of our generic dataCOMMENT
MEDIUMAlgorithm.Python/EmaCrossFuturesFrontMonthAlgorithm.py77 # Create a new consolidator and register the indicators to itCOMMENT
MEDIUMAlgorithm.Python/IndicatorSuiteAlgorithm.py103 # The following methods will add multiple charts to the algorithm output.COMMENT
MEDIUM…thon/HistoryWithCustomDataSourceRegressionAlgorithm.py49 # Create a new symbol as equity so we find the existing data filesCOMMENT
MEDIUM….Python/CrunchDAOSignalExportDemonstrationAlgorithm.py46 # Create a Scheduled Event to submit signals every monday before the market opensCOMMENT
MEDIUMAlgorithm.Python/CustomDataNIFTYAlgorithm.py30 # Define the symbol and "type" of our generic data:COMMENT
MEDIUM…ython/Collective2SignalExportDemonstrationAlgorithm.py41 # Create a new PortfolioTarget for each symbol, assign it an initial amount of 0.05 and save it in self.targets COMMENT
MEDIUMAlgorithm.Python/CustomIndicatorAlgorithm.py29 # Create a QuantConnect indicator and a python custom indicator for comparisonCOMMENT
MEDIUM⚡…orithm.Python/CustomConsolidatorRegressionAlgorithm.py31 #Create a 3:10PM custom quote bar consolidatorCOMMENT
MEDIUM⚡…orithm.Python/CustomConsolidatorRegressionAlgorithm.py41 #Create an indicator and register a consolidator to itCOMMENT
MEDIUMAlgorithm.Python/BasicTemplateOptionsPriceModel.py38 # Define the Option Price ModelCOMMENT
Empty Error Handlers9 hits · 45 pts
SeverityFileLineSnippetContext
HIGHResearch/start.py46except NameError:CODE
HIGH…lackLittermanOptimizationPortfolioConstructionModel.py266except:CODE
HIGHCommon/AlgorithmImports.py94except:CODE
HIGHCommon/PandasMapper.py83except KeyError as e:CODE
HIGH…hm.Python/BracketOrderLimitEntryRegressionAlgorithm.py61except ArgumentException:CODE
HIGH…thm.Python/BasicTemplateCryptoFutureHourlyAlgorithm.py32except:CODE
HIGHAlgorithm.Python/BasicTemplateCryptoFutureAlgorithm.py32except:CODE
HIGH…ython/OptionChainStrategyFiltersRegressionAlgorithm.py60except ArgumentException:CODE
HIGH…uestNotAllowedWithTickResolutionRegressionAlgorithm.py52except InvalidOperationException:CODE
AI Response Leakage5 hits · 38 pts
SeverityFileLineSnippetContext
HIGHTests/Python/PythonPackagesTests.cs993 # specifying a single input parameter. In this example, we just pass the randomCOMMENT
HIGHAlgorithm.Python/FuturesMomentumAlgorithm.py18### In this example, we demostrate how to trade futures contracts usingCOMMENT
HIGHAlgorithm.Python/DataConsolidationAlgorithm.py22### In this example we show one of the simplest consolidators, the TradeBarConsolidator.COMMENT
HIGHAlgorithm.Python/CustomDataUniverseAlgorithm.py18### and load data using the universe selection feature. In this example weCOMMENT
HIGHAlgorithm.Python/MovingAverageCrossAlgorithm.py17### In this example we look at the canonical 15/30 day moving average cross. This algorithmCOMMENT
Deep Nesting37 hits · 37 pts
SeverityFileLineSnippetContext
LOW…Framework/Execution/StandardDeviationExecutionModel.py44CODE
LOWAlgorithm.Framework/Execution/SpreadExecutionModel.py29CODE
LOW…/Execution/VolumeWeightedAveragePriceExecutionModel.py31CODE
LOW…folio/AccumulativeInsightPortfolioConstructionModel.py44CODE
LOW…lackLittermanOptimizationPortfolioConstructionModel.py83CODE
LOW…lackLittermanOptimizationPortfolioConstructionModel.py223CODE
LOW…ork/Alphas/PearsonCorrelationPairsTradingAlphaModel.py39CODE
LOWAlgorithm.Framework/Alphas/EmaCrossAlphaModel.py36CODE
LOW…ework/Risk/MaximumSectorExposureRiskManagementModel.py30CODE
LOWAlgorithm/Execution/ImmediateExecutionModel.py26CODE
LOWAlgorithm.Python/UpdateOrderRegressionAlgorithm.py53CODE
LOW…ConsolidateHourBarsIntoDailyBarsRegressionAlgorithm.py42CODE
LOWAlgorithm.Python/FuturesMomentumAlgorithm.py49CODE
LOWAlgorithm.Python/ObjectStoreExampleAlgorithm.py76CODE
LOW…thon/CustomDataUniverseScheduledRegressionAlgorithm.py51CODE
LOWAlgorithm.Python/BubbleAlgorithm.py65CODE
LOW….Python/FutureOptionPutITMExpiryRegressionAlgorithm.py56CODE
LOW…orithm.Python/OptionOpenInterestRegressionAlgorithm.py36CODE
LOW…Python/FutureOptionCallITMExpiryRegressionAlgorithm.py57CODE
LOWAlgorithm.Python/BasicTemplateCryptoAlgorithm.py63CODE
LOW…orithm.Python/FractionalQuantityRegressionAlgorithm.py44CODE
LOW…ython/SecuritySessionWithFuturesRegressionAlgorithm.py38CODE
LOW…thm.Python/ExpiryHelperAlphaModelFrameworkAlgorithm.py51CODE
LOWAlgorithm.Python/BasicTemplateEurexFuturesAlgorithm.py87CODE
LOWAlgorithm.Python/IndiaDataRegressionAlgorithm.py46CODE
LOWAlgorithm.Python/IndiaDataRegressionAlgorithm.py56CODE
LOWAlgorithm.Python/ComboOrderTicketDemoAlgorithm.py39CODE
LOWAlgorithm.Python/OptionRenameRegressionAlgorithm.py35CODE
LOW…hon/FutureOptionWithFutureFilterRegressionAlgorithm.py27CODE
LOW…ithm.Python/ConstituentsUniverseRegressionAlgorithm.py42CODE
LOW…/CanLiquidateWithOrderPropertiesRegressionAlgorithm.py29CODE
LOW….Python/NullMarginMultipleOrdersRegressionAlgorithm.py37CODE
LOW…thm.Python/ContingentOrderCancelRegressionAlgorithm.py33CODE
LOW…orithm.Python/CustomDataUniverseRegressionAlgorithm.py49CODE
LOWAlgorithm.Python/ComboOrdersFillModelAlgorithm.py45CODE
LOW…thm.Python/ContingentOrderUpdateRegressionAlgorithm.py31CODE
LOWAlgorithm.Python/Alphas/RebalancingLeveragedETFAlpha.py72CODE
Decorative Section Separators12 hits · 36 pts
SeverityFileLineSnippetContext
MEDIUMOptimizer/Analysis/OptimizationAnalyzer.cs83 // ── Aggregate helpers ────────────────────────────────────────────────────COMMENT
MEDIUMTests/Optimizer/Analysis/OptimizationAnalyzerTests.cs177 // ── helpers ──────────────────────────────────────────────────────────────COMMENT
MEDIUMTests/Common/Brokerages/WebullBrokerageModelTests.cs100 // ── CanSubmitOrder — Option/IndexOption TimeInForce restrictions ────────COMMENT
MEDIUMTests/Common/Brokerages/WebullBrokerageModelTests.cs171 // ── CanSubmitOrder — OutsideRegularTradingHours ──────────────────────────COMMENT
MEDIUMEngine/Results/Analysis/ResultsAnalyzer.cs205 // ── Test chain ────────────────────────────────────────────────────────────COMMENT
MEDIUMEngine/Results/Analysis/ResultsAnalyzer.cs567 // ── 1. backtest equity from "Strategy Equity" chart ──────────────────COMMENT
MEDIUMEngine/Results/Analysis/ResultsAnalyzer.cs579 // ── 2. Benchmark from SPY history ─────────────────────────────────────COMMENT
MEDIUMEngine/Results/Analysis/ResultsAnalyzer.cs599 // ── 3. Resample both to daily data points ────────────────────────────COMMENT
MEDIUMEngine/Results/Analysis/ResultsAnalyzer.cs608 // ── 4. Align the two curves on the same timestamps ───────────────────COMMENT
MEDIUM…alysis/Analyses/TakeProfitAndStopLossOrdersAnalysis.cs87 // ── Sub-analysis 1: both TP and SL filled ────────────────────────────────────────COMMENT
MEDIUM…sAnalyses/ExchangeNotOpenOrderResponseErrorAnalysis.cs72 // ── Sub-analysis: exercise while exchange not open ────────────────────────────────COMMENT
MEDIUM…sAnalyses/ExchangeNotOpenOrderResponseErrorAnalysis.cs94 // ── Sub-analysis: MOC order for Future / FOP ─────────────────────────────────────COMMENT
Verbosity Indicators12 hits · 22 pts
SeverityFileLineSnippetContext
LOW⚡…ckMonthOptionUsingCalendarSpreadRegressionAlgorithm.cs77 // Step 1: short front month putCOMMENT
LOW⚡…ckMonthOptionUsingCalendarSpreadRegressionAlgorithm.cs83 // Step 2: roll out front month put to back month put using a calendar spread.COMMENT
LOW…arp/FutureOptionWithFutureFilterRegressionAlgorithm.cs38 // Not all future contracts have option chains, so we need to check if the contract is in the optionCOMMENT
LOW…uidatingMultipleOptionStrategiesRegressionAlgorithm.cs84 // Step 1: buy spreadsCOMMENT
LOW…uidatingMultipleOptionStrategiesRegressionAlgorithm.cs116 // Step 2: liquidate spreadsCOMMENT
LOW⚡Tests/Brokerages/OrderCrossingBrokerageTests.cs475 // Step 1: Create order request under the hood of any brokerageCOMMENT
LOW⚡Tests/Brokerages/OrderCrossingBrokerageTests.cs479 // Step 2: Place the order request, paying attention to the flag 'isPlaceOrderWithoutLeanEvent'COMMENT
LOW⚡Tests/Brokerages/OrderCrossingBrokerageTests.cs482 // Step 3: Return the result of placing the orderCOMMENT
LOW…hon/FutureOptionWithFutureFilterRegressionAlgorithm.py31 # Not all future contracts have option chains, so we need to check if the contract is in the option chaiCOMMENT
LOWEngine/AlgorithmManager.cs224 // If backtesting/warmup, we need to check if there are realtime events in the pastCOMMENT
LOWEngine/AlgorithmManager.cs939 // we need to check if the security was removed.COMMENT
LOWEngine/DataFeeds/DateChangeTimeKeeper.cs203 // which already passed if we are moving on to the next data date. So we need to check if we need to emiCOMMENT
Slop Phrases7 hits · 18 pts
SeverityFileLineSnippetContext
MEDIUMAlgorithm.CSharp/IndicatorHistoryAlgorithm.cs61 // Let's log the BB values for the last 20 days, for demonstration purposes on how it can be enumeratedCOMMENT
MEDIUMAlgorithm.CSharp/SecurityCustomPropertiesAlgorithm.cs111 /// This custom fee is implemented for demonstration purposes only.COMMENT
LOWCommon/Data/DynamicData.cs194 // don't forget to add the dynamic members!COMMENT
MEDIUMAlgorithm.Python/SecurityCustomPropertiesAlgorithm.py76 '''This custom fee is implemented for demonstration purposes only.'''STRING
MEDIUMAlgorithm.Python/IndicatorHistoryAlgorithm.py45 # Let's log the BB values for the last 20 days, for demonstration purposes on how it can be enumeratedCOMMENT
MEDIUMAlgorithm.Python/IndicatorSuiteAlgorithm.py18### framework you can use for designing an algorithm.COMMENT
MEDIUMAlgorithm.Python/BasicTemplateAlgorithm.py18### framework you can use for designing an algorithm.COMMENT
Structural Annotation Overuse8 hits · 16 pts
SeverityFileLineSnippetContext
LOW⚡…ckMonthOptionUsingCalendarSpreadRegressionAlgorithm.cs77 // Step 1: short front month putCOMMENT
LOW⚡…ckMonthOptionUsingCalendarSpreadRegressionAlgorithm.cs83 // Step 2: roll out front month put to back month put using a calendar spread.COMMENT
LOW…uidatingMultipleOptionStrategiesRegressionAlgorithm.cs84 // Step 1: buy spreadsCOMMENT
LOW…uidatingMultipleOptionStrategiesRegressionAlgorithm.cs116 // Step 2: liquidate spreadsCOMMENT
LOW⚡Tests/Brokerages/OrderCrossingBrokerageTests.cs475 // Step 1: Create order request under the hood of any brokerageCOMMENT
LOW⚡Tests/Brokerages/OrderCrossingBrokerageTests.cs479 // Step 2: Place the order request, paying attention to the flag 'isPlaceOrderWithoutLeanEvent'COMMENT
LOW⚡Tests/Brokerages/OrderCrossingBrokerageTests.cs482 // Step 3: Return the result of placing the orderCOMMENT
LOWEngine/AlgorithmManager.cs922 // NOTE: This method assumes option contracts have the same core trading hours as their underlying contractCOMMENT
Cross-Language Confusion3 hits · 15 pts
SeverityFileLineSnippetContext
HIGH…k/Portfolio/MeanReversionPortfolioConstructionModel.py154 v_{t+1} = arg min || v - v_{t+1} || ^ 2STRING
HIGHCommon/PandasMapper.py105 # Try the original args; if true just return trueCOMMENT
HIGH…thon/HistoryWithCustomDataSourceRegressionAlgorithm.py38 if not aapl_history.equals(spy_history):CODE
Excessive Try-Catch Wrapping8 hits · 11 pts
SeverityFileLineSnippetContext
LOWfind_datasource_repos.py154 except Exception as e:CODE
LOW⚡Tests/Python/AlgorithmImportsTests.cs44 except Exception:CODE
LOW⚡Tests/Python/AlgorithmImportsTests.cs52 except Exception:CODE
MEDIUMTests/Python/AlgorithmImportsTests.cs41def except_clause_catches_python_exceptions():CODE
MEDIUMTests/Python/AlgorithmImportsTests.cs49def except_clause_catches_clr_exceptions(action):CODE
LOW…eFromMultipleTickTypeTickHistoryRegressionAlgorithm.py35 except Exception as e:CODE
LOW…m.Python/PythonDictionaryFeatureRegressionAlgorithm.py131 except Exception as e:CODE
LOWAlgorithm.Python/PandasDataFrameHistoryAlgorithm.py134 except Exception as e:CODE
Redundant / Tautological Comments6 hits · 9 pts
SeverityFileLineSnippetContext
LOWAlgorithm.Python/DropboxCoarseFineAlgorithm.py62 # Check if contains the row we needCOMMENT
LOW…gorithm.Python/BasicTemplateFutureRolloverAlgorithm.py57 # Check if information in SymbolData class and new slice data are ready for tradingCOMMENT
LOWAlgorithm.Python/TrainingExampleAlgorithm.py32 # Set TrainingMethod to be executed immediatelyCOMMENT
LOWAlgorithm.Python/TrainingExampleAlgorithm.py35 # Set TrainingMethod to be executed at 8:00 am every SundayCOMMENT
LOW….Python/Alphas/GasAndCrudeOilEnergyCorrelationAlpha.py92 ## Check if Natural Gas returns are greater than the threshold we've setCOMMENT
LOWAlgorithm.Python/Alphas/RebalancingLeveragedETFAlpha.py89 # Check if the returns are > 1% at 14.15COMMENT
AI Structural Patterns6 hits · 6 pts
SeverityFileLineSnippetContext
LOW…lackLittermanOptimizationPortfolioConstructionModel.py30CODE
LOWReport/ReportCharts.py138CODE
LOWReport/ReportCharts.py265CODE
LOWReport/ReportCharts.py656CODE
LOWReport/ReportCharts.py748CODE
LOWReport/ReportCharts.py973CODE
Example Usage Blocks2 hits · 3 pts
SeverityFileLineSnippetContext
LOWResearch/start.py17# Usage:COMMENT
LOWTests/Brokerages/OrderCrossingBrokerageTests.cs546 /// // Example usageCOMMENT
Modern Structural Boilerplate3 hits · 3 pts
SeverityFileLineSnippetContext
LOWAlgorithm.Python/RangeConsolidatorAlgorithm.py35 def set_start_and_end_dates(self) -> None:CODE
LOW…m.Python/OptionModelsConsistencyRegressionAlgorithm.py43 def set_models(self, security: Security) -> None:CODE
LOWAlgorithm.Python/CompleteOrderTagUpdateAlgorithm.py83 def update_order_tag(self, ticket: OrderTicket, tag: str, error_message_prefix: str) -> None:CODE
Fake / Example Data2 hits · 2 pts
SeverityFileLineSnippetContext
LOWReport/config.example.json5 "strategy-description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut CODE
LOWReport/config.example.json5 "strategy-description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut CODE
TODO Padding1 hit · 2 pts
SeverityFileLineSnippetContext
LOWOptimizer/Strategies/OptimizationStrategySettings.cs26 /// TODO: implementCOMMENT