Coder Social home page Coder Social logo

Comments (3)

conor19w avatar conor19w commented on July 26, 2024

Nice one, yeah I noticed the issue before but just ignored it because I wasn't sure if it was happening only on some candles.
Edge Case: What If a candle close happens as we download the data, probably best to just assume this is really unlikely.

When combining the historical data I do a comparison to see if the candle is later than the previous, maybe I should check that the candle interval length is uniform with the others instead.Then I could just remove the candle if it isn't uniform, this would solve both issues I guess.

from binance-futures-trading-bot.

conor19w avatar conor19w commented on July 26, 2024

After thinking further, I think your solution solves the problem entirely good work.
Either way if the candle closes or not mid download the websocket stream will have that candle so we are good to throw away the last one.

from binance-futures-trading-bot.

luki009 avatar luki009 commented on July 26, 2024

Exactly as you mentioned. Socket stream has current candle.. Thing is yeah scenario that in historical data you will pull closed candle is really unlikely (I even say impossible) because when candle close - new candle is formed immediately therefore socket stream has previous candle as closed .. Nearly impossible situation is that you will pull historical data in exact time of candle close on miliseconds precision. In that case it would happen that you will remove last whole candle therefore in data will be 1 candle skipped. but as was already concluded that is nearly impossible situation and I believe that new candle is formed by Binance at once with close of candle so there is no chance to get closed candle without new so you always get open candle.

from binance-futures-trading-bot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.