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

Incoming.prototype._POSITION_MULTI missing one field to be dequeued #144

Open
AdityaSantoso opened this issue Aug 1, 2019 · 1 comment

Comments

@AdityaSantoso
Copy link

AdityaSantoso commented Aug 1, 2019

When using reqPositionMulti, the resulting positionMulti event always incur an error like such

Unknown incoming first token: NaN

Upon closer debugging, it seems like Incoming.prototype._POSITION_MULTI should have one extra this.dequeue() to avoid having a field unconsumed. This causes the Incoming.prototype.process to always throw Unknown incoming first token

To repro: fire a reqPositionsMulti with modelCode null.

@AdityaSantoso
Copy link
Author

Comparing this with the C# equivalent, it seems like the last field should have belonged to the modelCode

private void PositionMultiEvent()
        {
            int msgVersion = ReadInt();
            int requestId = ReadInt();
            string account = ReadString();
            Contract contract = new Contract();
            contract.ConId = ReadInt();
            contract.Symbol = ReadString();
            contract.SecType = ReadString();
            contract.LastTradeDateOrContractMonth = ReadString();
            contract.Strike = ReadDouble();
            contract.Right = ReadString();
            contract.Multiplier = ReadString();
            contract.Exchange = ReadString();
            contract.Currency = ReadString();
            contract.LocalSymbol = ReadString();
            contract.TradingClass = ReadString();
            var pos = ReadDouble();
            double avgCost = ReadDouble();
            string modelCode = ReadString(); // <--- there is no equivalent to this in the javascript version
            eWrapper.positionMulti(requestId, account, modelCode, contract, pos, avgCost);
        }

@AdityaSantoso AdityaSantoso changed the title _POSITION_MULTI model always has one extra field not dequeued Incoming.prototype._POSITION_MULTI missing one field to be dequeued Aug 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant