¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: Commission report never called back.


 

Are you sure your ITradeReportHandler class does process
commissionReport() callbacks?
Yeah, I set a breakpoint inside the method and it never gets called. My TWS is 972.1v.
tradeReport is called just fine though. I'm going to assume that
commissionReport ought to be called prior to tradeReportEnd().

Semaphore barrier = new Semaphore(0);
Map<String, SingleExecution> result = new HashMap<>();
ibCon.reqExecutions(new ExecutionFilter() {
}, new ITradeReportHandler() {
@Override
public void tradeReport(String tradeKey, Contract contract, Execution execution) {
result.computeIfAbsent(tradeKey, k -> new SingleExecution()).set(tradeKey, contract, execution);
}

@Override
public void commissionReport(String tradeKey, CommissionReport commissionReport) {
result.computeIfAbsent(tradeKey, k -> new SingleExecution()).set(commissionReport);
}

@Override
public void tradeReportEnd() {
barrier.release();
}
});

barrier.acquire();

I suppose if you're getting called back reliably, then that gives me
hope that it's me and not them and I can sort it out.

Cheers,
G.


On Mon, 26 Jul 2021 15:22:23 -0700
"JR" <TwsApiOnGroupsIo@...> wrote:

We use (a pimped version) of ApiController as well, but trade and
commission reports come in reliably. That is true both for historical
executions (if there are some) the client receives right after
reqExecutions() as well as executions caused by client order
activities later on/

We are on API 9.81.01 (MAX_VERSION 157) and TWS 981.2w but I don't
recall any issues with 9.76.01.


JR

On Mon, Jul 26, 2021 at 02:54 PM, Graham Bygrave wrote:


Hey,

I'm never getting called back with any commission reports when I
request a list of executions from the TWS client.

I call: ApiController.reqExecutions(new ExecutionFilter(), new
ITradeReportHandler() {...})

I get my tradeReport method called back just fine, but I never get
my comissionReport called back and I want to see the commissions to
cross check against my own figures.

How come I don't get called back?

API_Version=9.76.01

Cheers,
G.




Join [email protected] to automatically receive all group messages.