Added buy/sell/passive volume to Volume At Price
This commit is contained in:
1 parent
39bf6ebaa5
commit
d1f346b28c
2 files changed
+9
No files matched your search
@@ -9,6 +9,9 @@ message VolumeAtPriceLevel{
|
||||
uint32 security_id = 20;
|
||||
double price = 30;
|
||||
uint32 volume = 40;
|
||||
uint32 buy_volume = 50;
|
||||
uint32 sell_volume = 60;
|
||||
uint32 passive_volume = 70;
|
||||
}
|
||||
|
||||
service MarketDataAuxiliaryService{
|
||||
|
||||
@@ -34,6 +34,12 @@ const VolumeAtPriceLevel& ChannelVolume::add_trade(const TradeMessage& m,
|
||||
}
|
||||
VolumeAtPriceLevel& vol=price_it->second;
|
||||
vol.set_volume(vol.volume()+m.size());
|
||||
if(m.aggressor_side()==AggressorSide::AGGRESSOR_SIDE_BUY)
|
||||
vol.set_buy_volume(vol.buy_volume()+m.size());
|
||||
else if(m.aggressor_side()==AggressorSide::AGGRESSOR_SIDE_SELL)
|
||||
vol.set_sell_volume(vol.sell_volume()+m.size());
|
||||
else if(m.aggressor_side()==AggressorSide::AGGRESSOR_SIDE_NONE)
|
||||
vol.set_passive_volume(vol.passive_volume()+m.size());
|
||||
return vol;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user