You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project seems to be the best and most complete on the Github. Thank you!
The new TWS API supports P&L data requests but it looks like this was never implemented. I was trying to do it myself but I am getting the following error: [12345:62:76:1:0:0:0:ERR] Invalid incoming request type - 0
Here are the functions:
`Outgoing.prototype.reqPnL = function (reqId, group, tags) {
if (this._controller._serverVersion < C.MIN_SERVER_VER.ACCT_SUMMARY) {
return this._controller.emitError('It does not support PNL requests.');
}
`IB.prototype.reqPnL = function (reqId, acctCode, contractID) {
assert(.isNumber(reqId), '"reqId" must be an integer - ' + reqId);
// assert(.isNumber(contractID), '"contractID" must be an integer - ' + contractID);
assert(_.isString(acctCode), '"acctCode" must be a string - ' + acctCode);
the old convention is not a problem, we can easily promisify those functions, I have done this already for some functions, as for ib-tws-api, I tried it and I do not see any advantages in it. It seems to be very incomplete and uses ES6, which I do not like. New nodejs also require importing as a module and it is not always practical. Not to mention the developer is not very collaborative, but maybe it is just my impression.
This project seems to be the best and most complete on the Github. Thank you!
The new TWS API supports P&L data requests but it looks like this was never implemented. I was trying to do it myself but I am getting the following error: [12345:62:76:1:0:0:0:ERR] Invalid incoming request type - 0
Here are the functions:
`Outgoing.prototype.reqPnL = function (reqId, group, tags) {
if (this._controller._serverVersion < C.MIN_SERVER_VER.ACCT_SUMMARY) {
return this._controller.emitError('It does not support PNL requests.');
}
var version = 1;
this._send(C.OUTGOING.REQ_PNL, version, reqId, group, tags);
};`
`IB.prototype.reqPnL = function (reqId, acctCode, contractID) {
assert(.isNumber(reqId), '"reqId" must be an integer - ' + reqId);
// assert(.isNumber(contractID), '"contractID" must be an integer - ' + contractID);
assert(_.isString(acctCode), '"acctCode" must be a string - ' + acctCode);
this._send('reqPnL', reqId, acctCode, contractID);
return this;
};`
Here is the reference for the API function: https://interactivebrokers.github.io/tws-api/pnl.html
Any help appreciated.
The text was updated successfully, but these errors were encountered: