{"action":"created","issue":{"url":"https://api.github.com/repos/ctubio/Krypto-trading-bot/issues/33","repository_url":"https://api.github.com/repos/ctubio/Krypto-trading-bot","labels_url":"https://api.github.com/repos/ctubio/Krypto-trading-bot/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/ctubio/Krypto-trading-bot/issues/33/comments","events_url":"https://api.github.com/repos/ctubio/Krypto-trading-bot/issues/33/events","html_url":"https://github.com/ctubio/Krypto-trading-bot/issues/33","id":239501150,"number":33,"title":"(Small improvement) wBBO + depth ","user":{"login":"Camille92","id":6861590,"avatar_url":"https://avatars3.githubusercontent.com/u/6861590?v=4","gravatar_id":"","url":"https://api.github.com/users/Camille92","html_url":"https://github.com/Camille92","followers_url":"https://api.github.com/users/Camille92/followers","following_url":"https://api.github.com/users/Camille92/following{/other_user}","gists_url":"https://api.github.com/users/Camille92/gists{/gist_id}","starred_url":"https://api.github.com/users/Camille92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Camille92/subscriptions","organizations_url":"https://api.github.com/users/Camille92/orgs","repos_url":"https://api.github.com/users/Camille92/repos","events_url":"https://api.github.com/users/Camille92/events{/privacy}","received_events_url":"https://api.github.com/users/Camille92/received_events","type":"User","site_admin":false},"labels":[{"id":626717295,"url":"https://api.github.com/repos/ctubio/Krypto-trading-bot/labels/acknowledged","name":"acknowledged","color":"fbca04","default":false},{"id":626717026,"url":"https://api.github.com/repos/ctubio/Krypto-trading-bot/labels/improvement","name":"improvement","color":"1d76db","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-06-29T14:36:13Z","updated_at":"2017-09-11T23:08:23Z","closed_at":"2017-09-11T23:08:23Z","author_association":"CONTRIBUTOR","body":"Hi Carles,\r\n\r\nJust for a small improvement this time, we talked about a way of calculating FV including the weight of not only the first orders but a few.\r\n\r\nHere is the simple formula:\r\nWe first calculate the total size of the orders in the book (maybe all the orders, maybe something preset by the user):\r\nVolBidSize = VolumeOrder1 + VolumeOrder2 + VolumeOrder3 ...\r\nVolAskSize = VolumeOrder1 + VolumeOrder2 + VolumeOrder3 ...\r\nTotalVolume = VolBidSize + VolAskSize\r\n\r\nThen we do a simple weighted average:\r\nwBB0 = (BestBidPrice * VolBidSize + BestAskPrice* VolAskSize) / TotalVolume\r\n\r\nThis should give a result always between the 2 BestPrice.\r\n\r\nAnother solution is to go simply for:\r\nWeighted AskPrice =VolumeOrderAsk1  * PriceOrderAsk1 + VolumeOrderAsk2  * PriceOrderAsk2 + VolumeOrderAsk3  * PriceOrderAsk3 ...\r\n\r\nWeightedBidPrice = VolumeOrderBid1  * PriceOrderBid1 + VolumeOrderBid2  * PriceOrderBid2 + VolumeOrderBid3  * PriceOrderBid3 ...\r\n\r\nwBBO = WeightedBidPrice + WeightedAskPrice / TotalVolume\r\n\r\nBut this can get results out of the two best offered prices and I don't know if it's something we want."},"comment":{"url":"https://api.github.com/repos/ctubio/Krypto-trading-bot/issues/comments/328683915","html_url":"https://github.com/ctubio/Krypto-trading-bot/issues/33#issuecomment-328683915","issue_url":"https://api.github.com/repos/ctubio/Krypto-trading-bot/issues/33","id":328683915,"user":{"login":"ctubio","id":1634027,"avatar_url":"https://avatars0.githubusercontent.com/u/1634027?v=4","gravatar_id":"","url":"https://api.github.com/users/ctubio","html_url":"https://github.com/ctubio","followers_url":"https://api.github.com/users/ctubio/followers","following_url":"https://api.github.com/users/ctubio/following{/other_user}","gists_url":"https://api.github.com/users/ctubio/gists{/gist_id}","starred_url":"https://api.github.com/users/ctubio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctubio/subscriptions","organizations_url":"https://api.github.com/users/ctubio/orgs","repos_url":"https://api.github.com/users/ctubio/repos","events_url":"https://api.github.com/users/ctubio/events{/privacy}","received_events_url":"https://api.github.com/users/ctubio/received_events","type":"User","site_admin":false},"created_at":"2017-09-11T23:08:23Z","updated_at":"2017-09-11T23:08:23Z","author_association":"OWNER","body":"this is not possible, because if the bot calculates a fair value that is over the sell price or under the buy price it will place taker orders nonstop; just because a big order is at depth +1 in some side."}}
{"actor":{"display_login":"ctubio"}}