Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing WS exception #25

Open
4 tasks
Romazes opened this issue Dec 20, 2024 · 0 comments
Open
4 tasks

Parsing WS exception #25

Romazes opened this issue Dec 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Romazes
Copy link
Contributor

Romazes commented Dec 20, 2024

Expected Behavior

Occasionally, we got the parsing exception.

Actual Behavior

image

Potential Solution

Probably, a problem in Alpaca SKD library.

Reproducing the Problem

Algo

public class UpgradedFluorescentOrangeManatee : QCAlgorithm
{
    Equity AAPL;
    Equity BND;
    Equity SPY;

    public UpgradedFluorescentOrangeManatee()
    {
        Logging.Log.DebuggingEnabled = true;
    }

    public override void Initialize()
    {
        SetStartDate(2024, 11, 20);
        SetEndDate(2024, 12, 20);

        SPY = AddEquity("SPY", Resolution.Second, extendedMarketHours: true);
        BND = AddEquity("BND", Resolution.Minute, extendedMarketHours: true);
        AAPL = AddEquity("AAPL", Resolution.Minute, extendedMarketHours: true);

        AddCrypto("BTCUSD");
    }

    /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
    /// Slice object keyed by symbol containing the stock data
    public override void OnData(Slice slice)
    {
        if (slice == null)
        {
            return;
        }

        var allData = new StringBuilder();
        for (var i = 0; i < slice.AllData.Count; i++)
        {
            var item = slice.AllData[i];

            if (item.Symbol.SecurityType == SecurityType.Option)
            {
                var underlying = item.Symbol.Underlying;
            }

            allData.AppendLine($"#{i}: Data Type: {item.DataType} | Time: {item.Time} | End Time: {item.EndTime} | Symbol: {item.Symbol} | Value: {item.Value} | Price: {item.Price}");
        }

        Log(allData.ToString() + "\n");
    }

}

System Information

Checklist

  • I have completely filled out this template
  • I have confirmed that this issue exists on the current master branch
  • I have confirmed that this is not a duplicate issue by searching issues
  • I have provided detailed steps to reproduce the issue
@Romazes Romazes added the bug Something isn't working label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant