My program was working successfully when all of a sudden I got a error and stopped the execution. Good thing that I was watching the market and close the trades. java.net.SocketTimeoutException: timeout at okio.Okio$4.newTimeoutException(Okio.java:230) at okio.AsyncTimeout.exit(AsyncTimeout.java:285) at okio.AsyncTimeout$2.read(AsyncTimeout.java:241) at okio.RealBufferedSource.indexOf(RealBufferedSource.java:345) at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:217) at okhttp3.internal.http1.Http1Codec.readHeaderLine(Http1Codec.java:212) at okhttp3.internal.http1.Http1Codec.readResponseHeaders(Http1Codec.java:189) 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:125) 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.execute(RealCall.java:77) at com.zerodhatech.kiteconnect.kitehttp.KiteRequestHandler.getRequest(KiteRequestHandler.java:133) at com.zerodhatech.kiteconnect.KiteConnect.getQuote(KiteConnect.java:542) at Zerodah.main(Zerodah.java:220) Caused by: java.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.socketRead(Unknown Source) at java.net.SocketInputStream.read(Unknown Source) at java.net.SocketInputStream.read(Unknown Source) at sun.security.ssl.InputRecord.readFully(Unknown Source) at sun.security.ssl.InputRecord.read(Unknown Source) at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source) at sun.security.ssl.SSLSocketImpl.readDataRecord(Unknown Source) at sun.security.ssl.AppInputStream.read(Unknown Source) at okio.Okio$2.read(Okio.java:139) at okio.AsyncTimeout$2.read(AsyncTimeout.java:237) ... 22 more Can I know why this happened?
This happened only once. I usually send less than 3 queries per second But one problem that I face consistently is that if I keep a profit between 200 and -600 the profit orders execute at 400+ and losses go upto -2000. Can I know what can be the reason? My statement is: if ((Profit >= 200) || (Profit <= -600)) {
@rakeshr yes I place market orders. But i see quotes lower than mine getting executed. E.g. If my profit margin is 200, there are order at 225 that will get get executed but mine won't. Is it that they have placed limit orders before me?
Is this consistent? How often do you make this call?
But one problem that I face consistently is that if I keep a profit between 200 and -600 the profit orders execute at 400+ and losses go upto -2000. Can I know what can be the reason? My statement is:
if ((Profit >= 200) || (Profit <= -600)) {
Are you placing limit or market order? For market orders, it's just executed at best available price.
and https://tradingqna.com/t/how-the-orders-executes-in-nse-server-limit-first-or-market-first/1138/5