QuantConnect / QuantConnect/Lean.DataSource.BrainSentiment

Universe Selection Uses Yesterday's Sentiment Values

Open
#14 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
2
Forks
10
PR merge metrics
No merged PRs in 30d

Description

Expected Behavior

When we use universe selection to select the security with the highest sentiment, the security should still have the highest sentiment by the time we can actually trade the security.

Actual Behavior
In backtests, universe selection runs at 12 AM Eastern Time (ET).
During universe selection, the BrainSentimentIndicatorUniverse objects contain the latest sentiment values at that moment in time, which is from the previous day at 7 AM ET.
After we select assets for the universe, we receive new sentiment values in the Update method at 7 AM ET.

As a result, the sentiment values we have during universe selection don't provide much utility. If we try to select the security with the highest sentiment in universe selection, by the time we can actually trade the security at 9:31 AM ET, we've received a new Brain Sentiment Indicator data point and the security likely won't have the highest sentiment out of all the securities in the dataset. In fact, the security could have the lowest sentiment.

Reproducing the Problem
Run this backtest. During universe selection, the security we select has positive sentiment, but by the time we can actually trade the security at market open, the security has negative sentiment.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the linked backtest and compare the sentiment value during universe selection with the value received by Update at 7 AM ET. Trace the BrainSentimentIndicatorUniverse objects and the universe-selection and Update entry points named in the report; no files or tests are identified. Done means the selected security's sentiment remains appropriate when trading begins.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.