Tucsky / SignificantTrades

better than 1 min chart
https://aggr.trade
GNU General Public License v3.0
623 stars 212 forks source link

What is the basis for merging volumes? #103

Open siderace opened 4 years ago

siderace commented 4 years ago

What is the basis for merging volumes?

I think it's in micrometers, is there a micrometer range? Or are there any other standards? Are the standards different for each exchange?

Tucsky commented 4 years ago

If you are referring to the way trades are merged into one in the list, its based on milliseconds. Most exchanges don't provide micro precision. So once a trade is received, it becomes a bucket. For every trades that come with the same exchange, side and same time (ms), its being added to the bucket (simple sum for vol, volume weighed average for bucket price). If a trade come from same exchange but different side or time > bucket time, bucket is released and dispatched to the list... Sometime no trades come to release it on time, and bucket is released by timeout (bucket time + 50ms). Same for all exchanges, no obscure trickery here 😄

siderace commented 4 years ago

Thank you very much!