Tucsky / SignificantTrades

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

WIP: added rough poc for absorbance indicator #48

Open kuegi opened 5 years ago

kuegi commented 5 years ago

it shows how to calc the move-per-direction for an indication of how the buy-trades moved the market compared to the sell trades. combined with the aggr. volume of the trades it shows how well the market absorbs the according volumes. my vue and js mojo is low so the UI is really just a rough POC.

fixes #44

Just saw that you started refactoring the arrays into objects. gotta look into that once you are done. Pullrequest is definitly WIP until someone fixes my dirty UI hacks...

Tucsky commented 5 years ago

Hey man thanks for the PR! I checked it out and let it run for a few minutes, buy move vs sell is pretty much all the time 50/50 so its kind of hard to determine anything from it at this point but I get the idea :) image Anyway, how do you read that? is counters the best way to display that info? (tbh I never used counters, I like charts more)

Just saw that you started refactoring the arrays into objects

I first designed the data structure with array because I read somewhere that "Arrays are mostly faster than objects" and trades is a lot of data. Now I figured out a way to compress the data, by stacking small trades into one see if that works... If it does array trade can be object I think, better readability, extensibility etc. Thats was the first goal of this debt/2.5 branch but now it is more like a 3.0 haha. Kinda stuck with it now, and its summer also so harder to get things done im afraid. The big feature of that 3.0 is implementation of that trading view chart (overall performance will get a huge boost) and dynamic series ("plugins" is what I want to achieve) With that done, we could make a absorbance indicator in the chart directly, CVD and all the good stuff Im also making more files (trying to divide things, less functions per files etc) to make it easier for contributors like you because today it is kind of a mess!

kuegi commented 5 years ago

No worries. I just realised that the numbers are only correct for the first row in the counter, the others are just the same. Honestly i am not yet fully in the stackedSums vs. strictSums vs. queue arrays... The PR is definitly a WIP :/

Arrays instead of objects for performance reasons makes sense. Not sure how much impact there really is thou.

Regarding the number. It shows how far the buy orders pushed the price compared to the sells. With the numbers from your screenshot: 11.83 M in buy orders pushed the price 14.92k up, vs 3.34 M in sell orders pushed the price 14.76k down. Thats also why i put it directly to the counters cause this way you easily see the difference between the volume-relation to the move-relation. Which in this case would mean that the market reacts far stronger to sell orders than to buy orders -> buy orders get absorbed easier.

Gotta analyse a bit more if the numbers really are correct thou. seems off to be so equally distributed.

kuegi commented 5 years ago

Found it :D messed up the socket and exchanges, so i had one lastPrice shared over all exchanges... fixed that. now the move makes more sense. (still pretty 50:50 thou, seems the market is usually pretty balanced)