project-nv / night-vision

Highly customizable charting library, created for professional traders
https://nightvision.dev
MIT License
250 stars 58 forks source link

Crosshair timestamp stops at last candle's timestamp instead of the expected future timestamp #32

Closed Jonarod closed 1 year ago

Jonarod commented 1 year ago

Describe the bug

When crosshair hovers above a candle that does not yet exists (in the future), the timestamp is stucked at the last timestamp of the dataset.

It should follow the expected timestamp based on timeframe inferred by scan.

Below, look at the timestamps, they are the same although on the second image, the crosshair is placed 2 candles' slots to the right of the last one:

Timestamp of last candle Timestamp of expected next candle slot

Reproduction

https://codesandbox.io/s/playing-around-1-15lwqr?file=/main.js

Steps to reproduce

In this sandbox, position the crosshair at the last date of the visible spline, then hover one "step" further to the right and compare the 2 timestamps: they are the same. They should be different, and the next "step" should actually be "guessed" to be last timestamp + 1 timeframe.

In that specific sandbox, the data ends at this timestamp: 1663477200000. So the next future timestamp to be "guessed" should be 1663477200000 + 1 timeframe, in that specific case, the timeframe being 1Hour, the next expected data point should be at 1663477200000 + 3600000 = 1663480800000

Javascript Framework

no-framework (vanilla-js)

Logs

No response

Validations

Jonarod commented 1 year ago

Correct me if I am wrong but as of 0.3.2 the issue is still here. Exactly the same: https://codesandbox.io/s/playing-around-1-15lwqr?file=/main.js

No?

C451 commented 1 year ago

Yep.

Jonarod commented 1 year ago

So why close ? Does this mean this will stay out of the scope of night-vision?

C451 commented 1 year ago

Coz commit -m "fix #NN"

Jonarod commented 1 year ago

So it was a mistake ? Why not re-open until a fix is found ?