Alpha indicator unneeded error
Closed this issue · 6 comments
The target and reference symbols cannot be the same.
but actually they yes can be.
This throws exception which if unhandled will crash the algorithm.
Maybe remove this error type since its not really an exception?
Hey @superichmann! Please share how to reproduce the issue so we can take a closer look
@Martin-Molinero sure here you go
public class heyhi : QCAlgorithm
{
private Symbol _symbol;
private Alpha hey;
public override void Initialize()
{
_symbol = AddEquity("SPY", Resolution.Daily).Symbol;
hey = A(_symbol,_symbol);
SetStartDate(2016,1,1);
SetStartDate(2024,1,1);
}
public override void OnData(Slice data)
{
if (hey.IsReady)
{
Plot("Alpha", "Alpha", hey);
}
}
}
Hi @superichmann ,
If the target and reference are the same, Beta is always 1, and Alpha is always 0, aren't they?
mmm probably @AlexCatarino but is it a reason to crash?;]
It's a reason to crash because it doesn't make sense to add an indicator with a known constant value.
If we don't throw an exception, the user will ask us, " Why is alpha always zero?" So we throw an exception to let them know.
lol ok @AlexCatarino thanks