TradeInfo

Custom indicators, trading strategies, data export and recording and more...
hedgefair
Posts: 11
Joined: Wed Nov 13, 2019 6:49 pm

TradeInfo

Post by hedgefair » Wed Nov 13, 2019 7:01 pm

after tradeInfo.isExecutionEnd is true...is there any quick method to get all the cumulative volume executed in the chain?

Andry API support
Posts: 548
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 25 times
Been thanked: 85 times

Re: TradeInfo

Post by Andry API support » Fri Nov 15, 2019 9:18 am

Hi hedgefair,
accumulate execution volumes from ExecutionInfo objects.

hedgefair
Posts: 11
Joined: Wed Nov 13, 2019 6:49 pm

Re: TradeInfo

Post by hedgefair » Fri Nov 15, 2019 12:28 pm

Thanks Andrey,

This is all I can see. How is it not showing up?
Attachments
tradeInfo.png
tradeInfo.png (100.43 KiB) Viewed 3728 times

Andry API support
Posts: 548
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 25 times
Been thanked: 85 times

Re: TradeInfo

Post by Andry API support » Fri Nov 15, 2019 1:59 pm

Hi hedgefair,
I could have misunderstood you so sorry for that. There are two cases of executed volumes - our own executions and somebody's else executions.
1) for somebody's else excecutions just add up sizes starting from the moment tradeInfo.isExecutionStart is true until tradeInfo.isExecutionEnd becomes true. That indicates that the execution chain came to an end.

Code: Select all

        if (tradeInfo.isExecutionStart) {
            accumulatedSizeExample = 0;
        }
        accumulatedSizeExample += size;
        if (tradeInfo.isExecutionEnd) {
            Log.info("another chain volume is " + accumulatedSizeExample);
        }
2) for your own executions use OrderLisnener and its method onOrderExecuted to get ExecutionInfo objects and use them in a similar manner.

Post Reply