peterszombati / xapi-node

xStation5 Trading API for NodeJS/JS
https://peterszombati.github.io/xapi-node/
Other
58 stars 19 forks source link

Tick prices showing up multiple times #15

Closed majorsauce closed 3 years ago

majorsauce commented 3 years ago

I seem to always get the tick prices 7 times in a row. Timestamp, ask, bid, volume and everything is exactly the same. Registered one listener to the tickPrice subscription.

To make sure it´s an issue I wrote a little connector for the API myself and there I get the data just once.

{"symbol":"EURUSD","ask":1.18726,"bid":1.18717,"high":1.18745,"low":1.18702,"askVolume":200000,"bidVolume":200000,"timestamp":1617750266568,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18726,"bid":1.18717,"high":1.18745,"low":1.18702,"askVolume":200000,"bidVolume":200000,"timestamp":1617750266568,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18726,"bid":1.18717,"high":1.18745,"low":1.18702,"askVolume":200000,"bidVolume":200000,"timestamp":1617750266568,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18726,"bid":1.18717,"high":1.18745,"low":1.18702,"askVolume":200000,"bidVolume":200000,"timestamp":1617750266568,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18726,"bid":1.18717,"high":1.18745,"low":1.18702,"askVolume":200000,"bidVolume":200000,"timestamp":1617750266568,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18726,"bid":1.18717,"high":1.18745,"low":1.18702,"askVolume":200000,"bidVolume":200000,"timestamp":1617750266568,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18726,"bid":1.18717,"high":1.18745,"low":1.18702,"askVolume":200000,"bidVolume":200000,"timestamp":1617750266568,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18725,"bid":1.18716,"high":1.18745,"low":1.18702,"askVolume":200000,"bidVolume":300000,"timestamp":1617750266742,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18725,"bid":1.18716,"high":1.18745,"low":1.18702,"askVolume":200000,"bidVolume":300000,"timestamp":1617750266742,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18725,"bid":1.18716,"high":1.18745,"low":1.18702,"askVolume":200000,"bidVolume":300000,"timestamp":1617750266742,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18725,"bid":1.18716,"high":1.18745,"low":1.18702,"askVolume":200000,"bidVolume":300000,"timestamp":1617750266742,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18725,"bid":1.18716,"high":1.18745,"low":1.18702,"askVolume":200000,"bidVolume":300000,"timestamp":1617750266742,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18725,"bid":1.18716,"high":1.18745,"low":1.18702,"askVolume":200000,"bidVolume":300000,"timestamp":1617750266742,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18725,"bid":1.18716,"high":1.18745,"low":1.18702,"askVolume":200000,"bidVolume":300000,"timestamp":1617750266742,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18725,"bid":1.18716,"high":1.18745,"low":1.18702,"askVolume":200000,"bidVolume":299000,"timestamp":1617750266993,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18725,"bid":1.18716,"high":1.18745,"low":1.18702,"askVolume":200000,"bidVolume":299000,"timestamp":1617750266993,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18725,"bid":1.18716,"high":1.18745,"low":1.18702,"askVolume":200000,"bidVolume":299000,"timestamp":1617750266993,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18725,"bid":1.18716,"high":1.18745,"low":1.18702,"askVolume":200000,"bidVolume":299000,"timestamp":1617750266993,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18725,"bid":1.18716,"high":1.18745,"low":1.18702,"askVolume":200000,"bidVolume":299000,"timestamp":1617750266993,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18725,"bid":1.18716,"high":1.18745,"low":1.18702,"askVolume":200000,"bidVolume":299000,"timestamp":1617750266993,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18725,"bid":1.18716,"high":1.18745,"low":1.18702,"askVolume":200000,"bidVolume":299000,"timestamp":1617750266993,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18726,"bid":1.18717,"high":1.18745,"low":1.18702,"askVolume":50000,"bidVolume":300000,"timestamp":1617750271371,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18726,"bid":1.18717,"high":1.18745,"low":1.18702,"askVolume":50000,"bidVolume":300000,"timestamp":1617750271371,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18726,"bid":1.18717,"high":1.18745,"low":1.18702,"askVolume":50000,"bidVolume":300000,"timestamp":1617750271371,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18726,"bid":1.18717,"high":1.18745,"low":1.18702,"askVolume":50000,"bidVolume":300000,"timestamp":1617750271371,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18726,"bid":1.18717,"high":1.18745,"low":1.18702,"askVolume":50000,"bidVolume":300000,"timestamp":1617750271371,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18726,"bid":1.18717,"high":1.18745,"low":1.18702,"askVolume":50000,"bidVolume":300000,"timestamp":1617750271371,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18726,"bid":1.18717,"high":1.18745,"low":1.18702,"askVolume":50000,"bidVolume":300000,"timestamp":1617750271371,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18726,"bid":1.18717,"high":1.18745,"low":1.18702,"askVolume":200000,"bidVolume":200000,"timestamp":1617750272636,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18726,"bid":1.18717,"high":1.18745,"low":1.18702,"askVolume":200000,"bidVolume":200000,"timestamp":1617750272636,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18726,"bid":1.18717,"high":1.18745,"low":1.18702,"askVolume":200000,"bidVolume":200000,"timestamp":1617750272636,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18726,"bid":1.18717,"high":1.18745,"low":1.18702,"askVolume":200000,"bidVolume":200000,"timestamp":1617750272636,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18726,"bid":1.18717,"high":1.18745,"low":1.18702,"askVolume":200000,"bidVolume":200000,"timestamp":1617750272636,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18726,"bid":1.18717,"high":1.18745,"low":1.18702,"askVolume":200000,"bidVolume":200000,"timestamp":1617750272636,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009} {"symbol":"EURUSD","ask":1.18726,"bid":1.18717,"high":1.18745,"low":1.18702,"askVolume":200000,"bidVolume":200000,"timestamp":1617750272636,"level":0,"quoteId":5,"spreadTable":0.9,"spreadRaw":0.00009}

majorsauce commented 3 years ago

Nevermind. I was using ts-node for testing which has created 7 processes for some reason. (Probably when reloading the app) Since I tested my own connector on another VSCode instance it did spin up a separate ts-node instance with only one process.