Repository Analysis

QuantConnect/Lean

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

9.2 Low AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of QuantConnect/Lean, a C# project with 20,523 GitHub stars. SynthScan v2.0 examined 826,095 lines of code across 4947 source files, recording 6189 pattern matches distributed across 21 syntactic categories. The overall adjusted score of 9.2 places this repository in the Low AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

9.2
Adjusted Score
9.2
Raw Score
100%
Time Factor
2026-07-13
Last Push
20.5K
Stars
C#
Language
826.1K
Lines of Code
4.9K
Files
6.2K
Pattern Hits
2026-07-14
Scan Date
0.05
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 13HIGH 230MEDIUM 265LOW 5681

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 6189 distinct pattern matches across 21 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. 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 diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Over-Commented Block4772 hits · 4452 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
4712 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.cs592 /// <param name="leverage">leverage for this security</param>COMMENT
MEDIUM…rithmFactory/Python/Wrappers/AlgorithmPythonWrapper.cs607 /// <param name="leverage">leverage for this security</param>COMMENT
MEDIUM…rithmFactory/Python/Wrappers/AlgorithmPythonWrapper.cs624 /// <param name="leverage">The requested leverage for this equity. Default is set by <see cref="SecurityInitialiCOMMENT
MEDIUM…rithmFactory/Python/Wrappers/AlgorithmPythonWrapper.cs637 /// <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
MEDIUMTests/Common/Securities/MarginCallModelTests.cs202 // leverage is 1 we shouldn't have more margin remainingCOMMENT
MEDIUMTests/Common/Securities/MarginCallModelTests.cs212 // now the stock plummets, leverage is 1 we shouldn't have more margin remainingCOMMENT
MEDIUMTests/Common/Securities/MarginCallModelTests.cs222 // this would not cause a margin call due to leverage = 1COMMENT
MEDIUMTests/Common/Securities/MarginCallModelTests.cs228 // now change the leverage to test margin call warning and margin call logicCOMMENT
MEDIUMTests/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.cs232 // Assert Leverage setting persisted for non options or futures (Blocked from setting leverage in SecuriCOMMENT
MEDIUMAlgorithm/QCAlgorithm.Trading.cs1631 /// 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.cs1401 // save the existing leverage specified in AddSecurity,COMMENT
MEDIUMAlgorithm/QCAlgorithm.cs1408 // restore the saved leverageCOMMENT
MEDIUMAlgorithm/QCAlgorithm.cs1919 /// <param name="leverage">Custom leverage per security</param>COMMENT
MEDIUMAlgorithm/QCAlgorithm.cs1923 /// <remarks> AddSecurity(SecurityType securityType, Symbol symbol, Resolution resolution, bool fillForward, decCOMMENT
MEDIUMAlgorithm/QCAlgorithm.cs1939 /// <param name="leverage">leverage for this security</param>COMMENT
MEDIUMAlgorithm/QCAlgorithm.cs1985 /// <param name="leverage">leverage for this security</param>COMMENT
MEDIUMAlgorithm/QCAlgorithm.cs2115 /// <param name="leverage">The requested leverage for this equity. Default is set by <see cref="SecurityInitialiCOMMENT
MEDIUMAlgorithm/QCAlgorithm.cs2133 /// <param name="leverage">The requested leverage for this equity. Default is set by <see cref="SecurityInitialiCOMMENT
MEDIUMAlgorithm/QCAlgorithm.cs2153 /// <param name="leverage">The requested leverage for the </param>COMMENT
MEDIUMAlgorithm/QCAlgorithm.cs2172 /// <param name="leverage">The requested leverage for the </param>COMMENT
167 more matches not shown…
Unused Imports620 hits · 596 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
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
LOWAlgorithm/Risk/CompositeRiskManagementModel.py14CODE
560 more matches not shown…
Hyper-Verbose Identifiers200 hits · 210 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
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
LOWTests/Indicators/RollingWindowTests.cs570def rolling_window_with_float():CODE
LOWTests/Indicators/RollingWindowTests.cs577def rolling_window_with_trade_bar():CODE
LOWTests/Indicators/RollingWindowTests.cs584def rolling_window_with_quote_bar():CODE
LOWTests/Indicators/RollingWindowTests.cs591def rolling_window_with_custom_data_type():CODE
LOWTests/Indicators/CompositeIndicatorTests.cs114def create_composite_indicator(left, right, operation):CODE
LOWTests/Algorithm/AlgorithmAddSecurityTests.cs342def add_security_initializers(algorithm):CODE
LOWTests/Algorithm/AlgorithmAddSecurityTests.cs477def add_security_initializers(algorithm):CODE
LOWTests/Algorithm/AlgorithmAddSecurityTests.cs566def add_security_initializers(algorithm):CODE
LOWTests/Algorithm/AlgorithmIndicatorsTests.cs700def create_intraday_vwap_indicator(name):CODE
LOW…thm/Framework/FrameworkModelsPythonInheritanceTests.cs136 def create_coarse_fundamental_universe(self, algorithm):CODE
LOWTests/Common/Securities/SecurityCacheTests.cs492def get_security_cache_margin_interest_rate():CODE
LOWTests/Common/Securities/SecurityCacheTests.cs498def 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
LOWTests/RegressionAlgorithms/Test_MethodOverload.py38 def call_plot_throw_managed_test(self):CODE
LOWTests/RegressionAlgorithms/Test_MethodOverload.py41 def call_plot_throw_pyobject_test(self):CODE
LOWAlgorithm/Selection/UniverseSelectionModel.py19 def get_next_refresh_time_utc(self) -> datetime:CODE
LOWCommon/Orders/Slippage/VolumeShareSlippageModel.py27 def get_slippage_approximation(self, asset: Security, order: Order) -> float:CODE
LOWToolBox/ConsolidatorDataProcessor.cs27 public class ConsolidatorDataProcessor : IDataProcessorCODE
LOWToolBox/FilteredDataProcessor.cs25 public class FilteredDataProcessor : IDataProcessorCODE
LOWToolBox/IDataProcessor.cs40 public static class DataProcessorCODE
LOWToolBox/CsvDataProcessor.cs29 public class CsvDataProcessor : IDataProcessorCODE
140 more matches not shown…
Hallucination Indicators13 hits · 130 pts
SeverityFileLineSnippetContext
CRITICALTests/Algorithm/AlgorithmHistoryTests.cs4457 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.cs157 var tickers = QuantConnect.Algorithm.CSharp.StressSymbols.StockSymbols.ToList();CODE
CRITICALTests/Common/Data/SubscriptionManagerTests.cs194 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
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
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
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.cs54 // ── Test chain ────────────────────────────────────────────────────────────COMMENT
MEDIUMEngine/Results/Analysis/ResultsAnalyzer.cs146 // ── 1. backtest equity from "Strategy Equity" chart ──────────────────COMMENT
MEDIUMEngine/Results/Analysis/ResultsAnalyzer.cs158 // ── 2. Benchmark from SPY history ─────────────────────────────────────COMMENT
MEDIUMEngine/Results/Analysis/ResultsAnalyzer.cs173 // ── 3. Resample both to daily data points ────────────────────────────COMMENT
MEDIUMEngine/Results/Analysis/ResultsAnalyzer.cs182 // ── 4. Align the two curves on the same timestamps ───────────────────COMMENT
MEDIUM…alysis/Analyses/TakeProfitAndStopLossOrdersAnalysis.cs81 // ── 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
Deep Nesting35 hits · 35 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…orithm.Python/CustomDataUniverseRegressionAlgorithm.py49CODE
LOWAlgorithm.Python/ComboOrdersFillModelAlgorithm.py45CODE
LOWAlgorithm.Python/Alphas/RebalancingLeveragedETFAlpha.py72CODE
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
LOWTests/Brokerages/OrderCrossingBrokerageTests.cs475 // Step 1: Create order request under the hood of any brokerageCOMMENT
LOWTests/Brokerages/OrderCrossingBrokerageTests.cs479 // Step 2: Place the order request, paying attention to the flag 'isPlaceOrderWithoutLeanEvent'COMMENT
LOWTests/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.cs204 // If backtesting/warmup, we need to check if there are realtime events in the pastCOMMENT
LOWEngine/AlgorithmManager.cs922 // 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
LOWTests/Brokerages/OrderCrossingBrokerageTests.cs475 // Step 1: Create order request under the hood of any brokerageCOMMENT
LOWTests/Brokerages/OrderCrossingBrokerageTests.cs479 // Step 2: Place the order request, paying attention to the flag 'isPlaceOrderWithoutLeanEvent'COMMENT
LOWTests/Brokerages/OrderCrossingBrokerageTests.cs482 // Step 3: Return the result of placing the orderCOMMENT
LOWEngine/AlgorithmManager.cs905 // 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
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
Excessive Try-Catch Wrapping4 hits · 4 pts
SeverityFileLineSnippetContext
LOWfind_datasource_repos.py154 except Exception as e:CODE
LOW…eFromMultipleTickTypeTickHistoryRegressionAlgorithm.py35 except Exception as e:CODE
LOW…m.Python/PythonDictionaryFeatureRegressionAlgorithm.py106 except Exception as e:CODE
LOWAlgorithm.Python/PandasDataFrameHistoryAlgorithm.py134 except Exception as e:CODE
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