Jump to content
Medved Trader Forums
Sign in to follow this  
Gorbay

T&S binance - bid/ask colors

Recommended Posts

i see

thanks for the reply

 

maybe  add another option  to color green if it was higher then the one before and red if its lower than one before

Share this post


Link to post
Share on other sites

is it really impossible to do ?
isnt it possible to get the bid and ask from first level in level 2 ?

how did ninjatrader managed to do it?

Share this post


Link to post
Share on other sites

i found out that binace does specify in the feed if the trade was bought by the maker or the taker..

here you can see: https://github.com/binance-exchange/binance-official-api-docs/blob/master/web-socket-streams.md

in the payload you get in the m variable (maker) the info if the its true it should show in red if its false it should show in green.
im not a professional programmer but i do know a bit.. i tried to program it in javascript and it works.

i upload the html file so you can see it works, just change the txt extention to .html and open it in the browser it will show the feed from neo/usdt with different colors for buyers or sellers.
 

 

websockettest.html.txt

Edited by Gorbay

Share this post


Link to post
Share on other sites

They do specify that but they are not sending best bid/ask together with the trade quote. Note: the best bid/ask that is sent together with the quote is (at least for all sources we use that do that) the best bid/ask *after* the trade is executed, not before. So even though they send whether it was bought by maker or taker, that does not provide enough information to deduce what the best bid/ask is at that moment (which is what the raw data in MT is supposed to be recording)...

Share this post


Link to post
Share on other sites

every trade that happens is the best bid or best ask, you cannot buy out of the market in binance
if the bid for example is 77.01 you cant sell it below this price without taking this bid too, if the trade is bigger than the size you have in the best bid it will be part filled on this price and go to the best bid after that for another trade
so every trade is being done with the best bid/ask

if it says the buyer is the maker, that means that the price that the trade was done is the price of the best bid and if the buyer is the taker that means the trade was done with the best ask price.

i dont know how it works in other feeds, but i cant see how it does not provide enough information giving the fact that there is no out of market trades..
its much easier to see if the trade was a buy or a sell.

maybe i am missing something but from what i see is all that is needed. look i attach a screenshot comparing what binance shows in their website and the file that i made and its the same

rawcolors.thumb.png.4f07eab821ea8ff25a868c8a3928a295.png

btcusdtrawcolortest.html.txt

Edited by Gorbay

Share this post


Link to post
Share on other sites

Ok, let me expand on it - what other feeds send you is:

 

1. Trade price

2. Best bid *AFTER* the trade was executed

3. Best ask *AFTER* the trade was executed

also, if the best bid/best ask change without a trade being executed (by someone canceling their book order, for example), that is also sent.

 

Knowing what the best bid or ask (note - not both, but just one or the other) is right before the trade was executed is not sufficient information and cannot be presented in the raw data window. Yes - let's say a trade is sent at X, as a buy. Which means that X was the best ask at the time right before the trade. But - what is the best bid *and* the best ask right after the trade? We don't know. Maybe the trade took out the best ask completely and now there is a new best ask and an unknown best bid. What can I display to the user?

 

Our "raw data" window shows more information than just the trade price and trade volume, red or green. It shows the best bids/asks, which binance does not send.

Share this post


Link to post
Share on other sites

To expand on it a bit more - I think the confusion here is because MT can color the prices based on comparing the trade price to the preceding bid and ask in the raw data window. That's how all the other feeds do it. When you get a trade you don't know if it was a buy or a sell. You just get a trade price and the new bid/ask.

Binance does the feed differently (and AFAIR it is the only one) - it tells you that it is a buy or a sell. Which is fine, but MT is geared to the way everyone is doing it and not to this particular way of doing things.

The screenshot from ninja - note that they do not show you the bid/ask for every trade. They show you the current best bid/ask. That can be deduced from the Level II (book) feed, but then you have to run that feed for every symbol, which would be hugely demanding both on bandwidth and on CPU.

Share this post


Link to post
Share on other sites

well i trade for years..

i traded the stock market with several platforms, and the colors are always set by the bid or ask at the time of the trade not after the trade.
i never care about the bid and ask after the trade, i can see it in the level 2 window.
all i want to see are trades, and  different colors for buys and sells..

i saw that  you have a filter to show bid/ask changes or only trades, i only use trades, i dont need to see bid/ask chages in the t&s, actually if i dont filter out the bid/ask changes the feed is useless to me.

for me level 2 is for bid/ask prices and t&s is for trades.
i dont need the t&s window saturated with data.

i  worked as a pro trader for a long time, i saw platforms, i know how t&s works,  the colors should always be green for a buy and red for a sell (by the price of the trade not after it) different color for out of market and different color for between the market (dark book / hidden orders)..

i understand that this feed works differently from the rest of the feeds, but isnt it possible to make binance raw feed  work  bit different than the rest ?
it already is because their feed is different isnt it ?
if its possible i would like to see buys as green and sells as red.

btw.. it seems to me that poloniex is the same.. no different colors no bid no ask in the raw feed window..

Edited by Gorbay

Share this post


Link to post
Share on other sites

Yes, the coloring is by the bid/ask at the time of the trade, not by the bid/ask after the trade - that is what I said.

 

But - when you use something like TD Ameritrade feed, the bid/ask/last row that you see in the Raw data is:

last = trade price

bid/ask - the bid and ask AFTER the trade

so the color of the price is by the bid/ask of the preceding row. Because that bid/ask is what was there at the time of the trade.

I will think about how to do this for binance. It may take some kludging to make it fit into the current way the quotes are stored.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×