Closed ejpjapan closed 6 years ago
You propose to use last price instead of close price when the market is closed. The issue with this is that a client that was connected since before the market closed will have a last price but a client connected after will not. They will then show different market prices. So it's more consistent to use the close price.
I think there may be a very minor issue with the marketPrice() method in the Ticker class. When the market is closed the bid and and ask will return a -1. When that happens the first conditional statement will return nan instead of last. As a result the next conditional statement returns the close. Instead the first conditional statement on line 109 should include an additional condition such as below:
Instead of: