Hello, look at this data :
{"amount":"2.001","date":1436471288,"date_ms":1436471288000,"price":"46.94","tid":109134569,"type":"sell"},{"amount":"2.001","date":1436471289,"date_ms":1436471289000,"price":"46.94","tid":109134571,"type":"sell"},{"amount":"2.001","date":1436471290,"date_ms":1436471290000,"price":"46.94","tid":109134576,"type":"sell"},{"amount":"2.001","date":1436471290,"date_ms":1436471290000,"price":"46.94","tid":109134579,"type":"sell"},{"amount":"1","date":1436471292,"date_ms":1436471292000,"price":"46.95","tid":109134587,"type":"buy"},{"amount":"4.21","date":1436471292,"date_ms":1436471292000,"price":"46.95","tid":109134589,"type":"buy"},{"amount":"8.299","date":1436471292,"date_ms":1436471292000,"price":"46.96","tid":109134591,"type":"buy"},{"amount":"5.346","date":1436471292,"date_ms":1436471292000,"price":"46.97","tid":109134593,"type":"buy"},{"amount":"2.001","date":1436471292,"date_ms":1436471292000,"price":"46.94","tid":109134594,"type":"sell"},{"amount":"10.2","date":1436471295,"date_ms":1436471295000,"price":"46.94","tid":109134615,"type":"sell"},
They are market data from a URL that refreshing too fast so new data will be added every second . I want to write a code to add amount of buy requests and amount of sell requests every second that the new data comes then have the buy sum and sell sum sepratelly . how to do this ?