Code Monkey home page Code Monkey logo

riko's People

Contributors

rishabh9 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

riko's Issues

Upstox has stopped their data APIs for new users.

I had used this library for sometime, but recently when I checked, Upstox is allowing data api access only to closed set of users. Unfortunately I unsubscribed from their data apis few months back and now they are not letting me to subscribe again.
Any alternate solution or workaround for getting NSE data. I don't need realtime data. Closing basis would work.
I checked other vendors like Globaldatafeeds etc. but they are charging hell lot of money.

Getting java.net.SocketTimeoutException when used historical service for fetching intraday data for nse_index instruments.

I get timeout exception, when I try to use historical service for fetching 1min or 5min olhc data for "nifty_50" or "nifty_bank". This works fine for all nse_eq instruments.

If I call api by using postman for "nifty_50" or "nifty_bank", I get data successfully.

Code:-
List<Candle> candles = historicalService.getOhlc("nse_index", "nifty_bank", "5MINUTE", "26-10-2018", "28-11-2018").get().getData();

Stacktrace:-

java.util.concurrent.ExecutionException: java.net.SocketTimeoutException: timeout
	at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
	at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2022)
	at com.strategy.tradebot.RenkoBT.generateHistoricalRenko(RenkoBacktest.java:150)
	at com.strategy.tradebot.RenkoBT.<init>(RenkoBacktest.java:119)
	at com.strategy.tradebot.RenkoBacktest.main(RenkoBacktest.java:52)
Caused by: java.net.SocketTimeoutException: timeout
	at okhttp3.internal.http2.Http2Stream$StreamTimeout.newTimeoutException(Http2Stream.java:593)
	at okhttp3.internal.http2.Http2Stream$StreamTimeout.exitAndThrowIfTimedOut(Http2Stream.java:601)
	at okhttp3.internal.http2.Http2Stream.takeResponseHeaders(Http2Stream.java:146)
	at okhttp3.internal.http2.Http2Codec.readResponseHeaders(Http2Codec.java:125)
	at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:88)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
	at com.github.rishabh9.riko.upstox.common.interceptors.HttpErrorLoggingInterceptor.intercept(HttpErrorLoggingInterceptor.java:46)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
	at com.github.rishabh9.riko.upstox.common.interceptors.AuthenticationInterceptor.intercept(AuthenticationInterceptor.java:56)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
	at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
	at okhttp3.RealCall$AsyncCall.execute(RealCall.java:147)
	at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

Incorrect Historical API url for 3.0.0-SNAPSHOT.

Getting error when called historical apis
{ "message": "'3861c062b31ce5548248ba062136b19a1499af52' not a valid key=value pair (missing equal-sign) in Authorization header: 'Bearer 3861c062b31ce5548248ba062136b19a1499af52'." }

I found that this is because of library is using incorrect url for getOHLC().

https://staging-api.upstox.com/historical/ohlc/NSE_EQ/HEG/1?start_date=02-01-2018&end_date=09-01-2018&format=json

"/ohlc" is not present in new url.

https://staging-api.upstox.com/historical/NSE_EQ/HEG/1?start_date=02-01-2018&end_date=09-01-2018&format=json

Removing /ohlc should work.

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.