websocket aggregate buy(green) sell(red)

in websocket aggregate trades , how to know if its buy or its sell … on usually it show sell is (red) and buy is (green) but is aggregate api its not show nothig if its sell or buy !!

and in fututre aggregate trade (how to know if its short or long ) ??

Aggregate trade only represents the trade pair (buy-sell) itself, so you won’t be able to know which side (buy or sell) the price came from. Same goes for futures.

many thanks to replay ,ok , is there is any solution how to knew if its sell or buy ?? in binance trade boq show the sell is (red) and buy is (green) how to apply it on api aggregate ? please i need solution

You need to have a better understanding of what a trade means. Each spot trade has buy side and sell side and each futures trade has long and short side. Are you actually trying to ask which side is a maker?

iam understanding you brother , but websocket aggregate not showing data if the buyer maker or taker

Please read the document again - https://binance-docs.github.io/apidocs/spot/en/#aggregate-trade-streams

{
“e”: “aggTrade”, // Event type
“E”: 123456789, // Event time
“s”: “BNBBTC”, // Symbol
“a”: 12345, // Aggregate trade ID
“p”: “0.001”, // Price
“q”: “100”, // Quantity
“f”: 100, // First trade ID
“l”: 105, // Last trade ID
“T”: 123456785, // Trade time
"m": true, // Is the buyer the market maker?
“M”: true // Ignore
}

I HAVE PROPLEM BROTHER WITH SINGED IN API , IT KEEP TELLING ME
( SIGNATURE FOR THIS REQUEST IS NOT VALID )

MY CODE IS

script type=“text/javascript” src=“crypto-js.js”>

var burl = 'https://api.binance.com';
var endPoint = '/api/v3/account';
var dataQueryString = 'recvWindow=20000&timestamp=' + Date.now();

var keys = {
    'akey' : '  ',
    'skey' : '  '
}

var signature = CryptoJS.HmacSHA256(dataQueryString ,keys['skey']).toString(CryptoJS.enc.Hex);

var ourRequest = new XMLHttpRequest();

var url = burl + endPoint + '?' + dataQueryString + '&signature=' + signature;

ourRequest.open('GET', url, true);
ourRequest.setRequestHeader('X-MBX-APIKEY',keys['akey']);

ourRequest.onload = function(){
    ourData = JSON.parse(ourRequest.responseText);
    console.log(ourData);
}
ourRequest.send();

WHAT IS THE PROPLEM PLEASE

Maybe the problem is that you are calling the open method before declaring the listeners, try setting the listener of the onload event after creating the XMLHttpRequest object and before using the open and send methods

This is entirely another issue. Please open a new topic. I’m going to delete this post