Volume data

Custom indicators, trading strategies, data export and recording and more...
lnszmjhe
Posts: 22
Joined: Sat Feb 17, 2024 2:39 am

Volume data

Post by lnszmjhe » Thu May 09, 2024 4:23 pm

Dear support.
How do I write volume data to a .txt file?

 
Attachments
Bookmap.png
Bookmap.png (244.51 KiB) Viewed 307 times

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

Re: Volume data

Post by Andry API support » Fri May 10, 2024 5:37 am

Hi,
have you got any programming experience in Java or Python?

lnszmjhe
Posts: 22
Joined: Sat Feb 17, 2024 2:39 am

Re: Volume data

Post by lnszmjhe » Fri May 10, 2024 10:40 am

Hi Andry,
Yes, in Java or Python, I have better command of Java.
I just don't know where to extract the data that represents the indicated volume.

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

Re: Volume data

Post by Andry API support » Fri May 10, 2024 11:17 am

We recommend to start with Simplified API. Please see the readme file first
https://github.com/BookmapAPI/DemoStrategies
Use this addon as an example
https://github.com/BookmapAPI/DemoStrat ... yData.java
just add some writer which will perform writes every time onTrade method is triggered.
A single trade volume is onTrade#size multiplied by InstrumentInfo#sizeMultiplier (take the latter from the #initialize method).
These videos may also be helpful
https://www.youtube.com/playlist?list=P ... 1MUHTzzX1v

lnszmjhe
Posts: 22
Joined: Sat Feb 17, 2024 2:39 am

Re: Volume data

Post by lnszmjhe » Sat May 11, 2024 1:36 pm

Hi Andry, thanks.
So, how to identify when it is a Volume for sale or purchase?
Thank you for the information.

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

Re: Volume data

Post by Andry API support » Tue May 14, 2024 7:04 am

onTrade method -> TradeInfo parameter -> TradeInfo#isBidAggressor .
aggressor here typically means a market order taking liquidity from the orderbook.
E.g. `isBidAggressor == true` means there was a buy market order taking liquidity from asks.

Post Reply