How to Get All Historic Data from Binance's API Using this Script, and Build MACD, RSI etc.

Entelechy

Stadivm Owner
Staff member
Joined
Jul 8, 2018
Messages
191
Reaction score
30
Location
Stadivm.com
Hi, can you explain a bit more what the issue is and I'll try to help you debug it?
 

Entelechy

Stadivm Owner
Staff member
Joined
Jul 8, 2018
Messages
191
Reaction score
30
Location
Stadivm.com
That script gathers historic data and you should be getting close to current. It's designed for using for backtesting. So you would gather data over a period of time, and then use that data to test your algorithms.

If you need current data then using websockets is better, because that script uses a rest API. What are you trying to do with the script? Do you want it for testing an algorithm?
 

workdezire

Freshman
Joined
Aug 11, 2019
Messages
15
Reaction score
2
Location
India
Ok its using rest api fine, what i want is current hours Upper ,Lower and Middle of bollbingers bands data which i am getting of 2hrs ago, it should give me current hours or atleast last hours data,
 

Entelechy

Stadivm Owner
Staff member
Joined
Jul 8, 2018
Messages
191
Reaction score
30
Location
Stadivm.com
Yes it should be giving you the data up to maximum one hour ago. How far back are you taking the data from? Are you taking the entire history of Binance?
 

workdezire

Freshman
Joined
Aug 11, 2019
Messages
15
Reaction score
2
Location
India
no i started the script 2 hrs ago and i have data collected of 48 hrs till now, but the last hours data is of 2hrs ago.
 

Entelechy

Stadivm Owner
Staff member
Joined
Jul 8, 2018
Messages
191
Reaction score
30
Location
Stadivm.com
Let me take a quick look at the script now. Please just give me a minute or two.
 

Entelechy

Stadivm Owner
Staff member
Joined
Jul 8, 2018
Messages
191
Reaction score
30
Location
Stadivm.com
If you check the epoch time its of 8 am current is 11am.
Can you run this: https://api.binance.com/api/v1/klines?symbol=ETHBTC&interval=1h in the browser, and compare that against what you are getting when you run the script. Check whether the current price is the same for the results of the script and that rest call.

The time that you're getting as the last time stamp might be different from your local time, but the price should be the same if the script is functional.
 

Entelechy

Stadivm Owner
Staff member
Joined
Jul 8, 2018
Messages
191
Reaction score
30
Location
Stadivm.com
There shouldn't be a gap of 3hrs missing from the data. I'm also not normally running it for only 48 hours of 1h data though. What is the interval you are using? 1hr?
 

workdezire

Freshman
Joined
Aug 11, 2019
Messages
15
Reaction score
2
Location
India
There shouldn't be a gap of 3hrs missing from the data. I'm also not normally running it for only 48 hours of 1h data though. What is the interval you are using? 1hr?
I need to check on it gimi some time i will reply back
 

Entelechy

Stadivm Owner
Staff member
Joined
Jul 8, 2018
Messages
191
Reaction score
30
Location
Stadivm.com
Sure, I am here for a few more hours tonight. Let me know and I'll try to help you resolve it.
 

Entelechy

Stadivm Owner
Staff member
Joined
Jul 8, 2018
Messages
191
Reaction score
30
Location
Stadivm.com
is it possible for you to be available tomorrow also same time
No problem, I'll be here the same time tomorrow and we can go over the script again then. Also, yes, the bollingers should be current and the data should be current also.