Open AdityaSantoso opened 4 years ago
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);
}
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 theIncoming.prototype.process
to always throwUnknown incoming first token
To repro: fire a reqPositionsMulti with modelCode null.