Title: Incorrect Forex Price Spikes · Issue #668 · massive-com/client-python · GitHub
Open Graph Title: Incorrect Forex Price Spikes · Issue #668 · massive-com/client-python
X Title: Incorrect Forex Price Spikes · Issue #668 · massive-com/client-python
Description: Forex Websocket prices ("CAS.*") and Agg Data have occasional price spikes. These price spikes don't align with TradingView chart or Forex.com. I found the reason why: Polygon.io is using exchange bid price instead of trade price to popu...
Open Graph Description: Forex Websocket prices ("CAS.*") and Agg Data have occasional price spikes. These price spikes don't align with TradingView chart or Forex.com. I found the reason why: Polygon.io is using exchange ...
X Description: Forex Websocket prices ("CAS.*") and Agg Data have occasional price spikes. These price spikes don't align with TradingView chart or Forex.com. I found the reason why: Polygon.io is u...
Opengraph URL: https://github.com/massive-com/client-python/issues/668
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Incorrect Forex Price Spikes","articleBody":"Forex Websocket prices (\"CAS.*\") and Agg Data have occasional price spikes. These price spikes don't align with TradingView chart or Forex.com. \r\n\r\nI found the reason why:\r\nPolygon.io is using exchange bid price instead of trade price to populate websocket and agg data.\r\n\r\n\r\nHere I am printing prices of CADJPY. The price 112.735 is an outlier that never happened. That price came from a stink bid on the exchange.\r\n\r\nPrint outs of Aggs and Quotes for the surrounding timestamps:\r\n\r\n```\r\nagg Agg(open=113.7, high=113.7, low=113.7, close=113.7, volume=1, vwap=113.7, timestamp=1715288494000, transactions=1, otc=None) dt 8999 ms\r\nagg Agg(open=112.735, high=112.735, low=112.735, close=112.735, volume=1, vwap=112.735, timestamp=1715288495000, transactions=1, otc=None) dt 7999 ms\r\nagg Agg(open=112.735, high=112.735, low=112.735, close=112.735, volume=1, vwap=112.735, timestamp=1715288497000, transactions=1, otc=None) dt 5999 ms\r\nagg Agg(open=113.53, high=113.53, low=113.53, close=113.53, volume=1, vwap=113.53, timestamp=1715288500000, transactions=1, otc=None) dt 2999 ms\r\nagg Agg(open=113.682, high=113.682, low=113.682, close=113.682, volume=1, vwap=113.682, timestamp=1715288503000, transactions=1, otc=None) dt -1 ms\r\nagg Agg(open=112.735, high=112.735, low=112.735, close=112.735, volume=1, vwap=112.735, timestamp=1715288504000, transactions=1, otc=None) dt -1001 ms\r\nagg Agg(open=113.62, high=113.62, low=113.62, close=113.62, volume=1, vwap=113.62, timestamp=1715288505000, transactions=1, otc=None) dt -2001 ms\r\nagg Agg(open=113.7, high=113.7, low=113.7, close=113.7, volume=1, vwap=113.7, timestamp=1715288509000, transactions=1, otc=None) dt -6001 ms\r\nagg Agg(open=113.63, high=113.63, low=113.63, close=113.63, volume=1, vwap=113.63, timestamp=1715288510000, transactions=1, otc=None) dt -7001 ms\r\n\r\n```\r\n\r\n\r\n```\r\nquote Quote(ask_exchange=48, ask_price=113.66, ask_size=None, bid_exchange=48, bid_price=113.62, bid_size=None, conditions=None, indicators=None, participant_timestamp=1715288505000000000, sequence_number=None, sip_timestamp=None, tape=None, trf_timestamp=None)\r\nquote Quote(ask_exchange=48, ask_price=114.358, ask_size=None, bid_exchange=48, bid_price=112.735, bid_size=None, conditions=None, indicators=None, participant_timestamp=1715288504000000000, sequence_number=None, sip_timestamp=None, tape=None, trf_timestamp=None)\r\nquote Quote(ask_exchange=48, ask_price=113.805, ask_size=None, bid_exchange=48, bid_price=113.682, bid_size=None, conditions=None, indicators=None, participant_timestamp=1715288503000000000, sequence_number=None, sip_timestamp=None, tape=None, trf_timestamp=None)\r\nquote Quote(ask_exchange=48, ask_price=113.57, ask_size=None, bid_exchange=48, bid_price=113.53, bid_size=None, conditions=None, indicators=None, participant_timestamp=1715288500000000000, sequence_number=None, sip_timestamp=None, tape=None, trf_timestamp=None)\r\n\r\n\r\n```\r\n\r\n\r\nAttaching images of these crazy spikes when monitoring websocket data:\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nPossible solutions:\r\n1. Get actual trade data from data providers and use this to populate websocket and agg data instead of faking it.\r\n\r\n2. If trade data is not available, i recommend averaging the bid and ask price instead of just using the bid price. If the delta between bid and ask is too high, discard the price point. This seems to produce reasonable results. \r\n\r\n\r\nWithout a solution, there seems to be no point to having the \"\"CAS.*\" and \"Agg\" data when it merely uses the bid price in the existing Quote data. I implemented solution #2 already in my branch if you want to reference it, Solution #1 is the proper and preferred fix tho","author":{"url":"https://github.com/jbonilla-tao","@type":"Person","name":"jbonilla-tao"},"datePublished":"2024-05-10T23:12:47.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/668/client-python/issues/668"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:82aa5fa3-eeb0-53c4-0654-f47c08a2f22b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AEC6:366857:C8CBDB:1181A0D:6A4E8A81 |
| html-safe-nonce | 5ed3a8424054e9c3551919808323da1561c66cdbf9e808e30748d0019d30aab0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRUM2OjM2Njg1NzpDOENCREI6MTE4MUEwRDo2QTRFOEE4MSIsInZpc2l0b3JfaWQiOiIyMTQ1NjEwOTAyMzA4NTU1MzkzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b4aa425fbcfafecb413ded70ebb1fb7254a097b256157ab0c4cd4bddd90de0da |
| hovercard-subject-tag | issue:2290512725 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/massive-com/client-python/668/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6dc598830179d8a058b6447afea2c8af80e70d0485fb60b15587b6b5bcda917f/massive-com/client-python/issues/668 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6dc598830179d8a058b6447afea2c8af80e70d0485fb60b15587b6b5bcda917f/massive-com/client-python/issues/668 |
| og:image:alt | Forex Websocket prices ("CAS.*") and Agg Data have occasional price spikes. These price spikes don't align with TradingView chart or Forex.com. I found the reason why: Polygon.io is using exchange ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jbonilla-tao |
| hostname | github.com |
| expected-hostname | github.com |
| None | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| turbo-cache-control | no-preview |
| go-import | github.com/massive-com/client-python git https://github.com/massive-com/client-python.git |
| octolytics-dimension-user_id | 191946194 |
| octolytics-dimension-user_login | massive-com |
| octolytics-dimension-repository_id | 216660192 |
| octolytics-dimension-repository_nwo | massive-com/client-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 216660192 |
| octolytics-dimension-repository_network_root_nwo | massive-com/client-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width