Giter VIP home page Giter VIP logo

iextrading4j's Introduction

Hi there, it is me πŸ‘‹

Linkedin Badge

Self-driven, passionate and committed software engineer specializing in market trading and asset management discipline. Flexible with languages, tools and everything that leads to good solution. Enjoying his life in the beautiful area of ZΓΌrich πŸ‡¨πŸ‡­. From time to time I commit to open source :octocat: projects.

iextrading4j's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

iextrading4j's Issues

Library is not working because of dependencies

Describe the bug
With other dependencies library is failing because of lack of dependencies.

To Reproduce

  1. Create Spring Boot project
  2. Add dependency to IEXTrading4j library
  3. Library is not able to parse response because of missing dependency

Expected behavior
Library should work fine with other frameworks

Additional context

Caused by: org.glassfish.jersey.message.internal.MessageBodyProviderNotFoundException: MessageBodyReader not found for media type=application/json;charset=utf-8, type=interface java.util.List, genericType=java.util.List<pl.zankowski.iextrading4j.api.stocks.Chart>.
	at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$TerminalReaderInterceptor.aroundReadFrom(ReaderInterceptorExecutor.java:231)
	at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor.proceed(ReaderInterceptorExecutor.java:155)
	at org.glassfish.jersey.message.internal.MessageBodyFactory.readFrom(MessageBodyFactory.java:1085)
	at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:874)
	at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:834)
	at org.glassfish.jersey.client.ClientResponse.readEntity(ClientResponse.java:368)
	at org.glassfish.jersey.client.InboundJaxrsResponse$2.call(InboundJaxrsResponse.java:126)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:228)
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:419)
	at org.glassfish.jersey.client.InboundJaxrsResponse.runInScopeIfPossible(InboundJaxrsResponse.java:267)
	at org.glassfish.jersey.client.InboundJaxrsResponse.readEntity(InboundJaxrsResponse.java:123)
	at pl.zankowski.iextrading4j.client.rest.manager.RestManager.executeRequest(RestManager.java:38)
	... 33 more

Future dividends not present in API Query

Is your feature request related to a problem? Please describe.
I was hoping to write some code like this to get the future dividends:
List<pl.zankowski.iextrading4j.api.stocks.v1.Dividends> futureDividends =
cloudClient.executeRequest(new DividendsRequestBuilder()
.withSymbol(symbol)
.withDividendRange(DividendRange.NEXT)
.build());

Unfortunately, the DividendRange enumeration does not have the NEXT enumeration.

Describe the solution you'd like
I just need the DividendRange enumeration to include the NEXT with value "next", as specified in the IEXCloud API.

Describe alternatives you've considered
The other alternative is to create my own REST call with JAX-RS client to get future dividends but I believe that this should be included in this API. I am already preparing a pull request for this.

Additional context
Add any other context or screenshots about the feature request here.

DEEP Connection was leaked

Describe the bug
Using multiple DEEP websocket trade requests for different symbols, after a while I start exclusively etting this error:

WARNING: A connection to https://ws-api.iextrading.com/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);
Nov 27, 2018 2:58:50 PM okhttp3.internal.platform.Platform log

To Reproduce
Steps to reproduce the behavior:
Here's my implementation:

	public static void setupAsyncDeep(Collection<String> symbols)  {
		symbols.stream().forEach(x -> setupAsyncDeep(x));
	}
	
	public static void setupAsyncDeep(String symbol) {
		final SocketRequest<DeepAsyncResponse<DeepResult>> request = new DeepAsyncRequestBuilder()
		        .addChannel(DeepChannel.TRADES)
		        .withSymbol(symbol)
		        .build();

		iexTradingClient.subscribe(request, x -> processDeepTrade(symbol,x));
	}

	public static void processDeepTrade(String symbol, DeepAsyncResponse<DeepResult> x) {
		Trade t = (Trade) x.getData();
		//processTrade(symbol,t); //Application Specific Database Store
		
		System.out.println("Trade Logged: " + t);
	}

After 30 minutes to an hour The above warning error message repeats every time data arrives. No other console output occurs.

Expected behavior
The socket should continue to process data correctly as it comes in.

Screenshots
image

Additional context
At least for now, you can't specify multiple symbols in a single deep request (According to the IEX documentation). Hence the multiple requests.

IllegalStateException

Summary

Hi Woj,

I am getting this error now getting a quote.

java.lang.IllegalStateException: MessageBodyReader not found for media type=text/html; charset=utf-8, type=class pl.zankowski.iextrading4j.api.stocks.Quote, genericType=class pl.zankowski.iextrading4j.api.stocks.Quote.
at pl.zankowski.iextrading4j.client.rest.manager.RestManager.executeRequest(RestManager.java:41)
at pl.zankowski.iextrading4j.client.rest.AbstractRestEndpoint.execute(AbstractRestEndpoint.java:16)
at pl.zankowski.iextrading4j.client.rest.endpoint.GenericRestEndpoint.executeRequest(GenericRestEndpoint.java:14)
at pl.zankowski.iextrading4j.client.IEXTradingClient.executeRequest(IEXTradingClient.java:35)
at com.stocktracker.servicelayer.stockinformationprovider.IEXTradingStockService.getIEXTradingQuote(IEXTradingStockService.java:57)
at com.stocktracker.servicelayer.stockinformationprovider.IEXTradingStockService.getStockTickerQuote(IEXTradingStockService.java:38)
at com.stocktracker.servicelayer.stockinformationprovider.StockQuoteServiceExecutor.getQuoteFromIEXTrading(StockQuoteServiceExecutor.java:186)
at com.stocktracker.servicelayer.stockinformationprovider.StockQuoteServiceExecutor.asynchronousGetStockQuote(StockQuoteServiceExecutor.java:53)
at com.stocktracker.servicelayer.stockinformationprovider.StockQuoteServiceExecutor$$FastClassBySpringCGLIB$$3cc405ee.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.aop.interceptor.AsyncExecutionInterceptor$1.call(AsyncExecutionInterceptor.java:115)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.glassfish.jersey.message.internal.MessageBodyProviderNotFoundException: MessageBodyReader not found for media type=text/html; charset=utf-8, type=class pl.zankowski.iextrading4j.api.stocks.Quote, genericType=class pl.zankowski.iextrading4j.api.stocks.Quote.
at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$TerminalReaderInterceptor.aroundReadFrom(ReaderInterceptorExecutor.java:173)
at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor.proceed(ReaderInterceptorExecutor.java:134)
at org.glassfish.jersey.message.internal.MessageBodyFactory.readFrom(MessageBodyFactory.java:988)
at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:833)
at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:795)
at org.glassfish.jersey.client.InboundJaxrsResponse.readEntity(InboundJaxrsResponse.java:102)
at org.glassfish.jersey.client.ScopedJaxrsResponse.access$101(ScopedJaxrsResponse.java:56)
at org.glassfish.jersey.client.ScopedJaxrsResponse$2.call(ScopedJaxrsResponse.java:87)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:228)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:397)
at org.glassfish.jersey.client.ScopedJaxrsResponse.readEntity(ScopedJaxrsResponse.java:84)
at pl.zankowski.iextrading4j.client.rest.manager.RestManager.executeRequest(RestManager.java:38)
... 16 common frames omitted

Details

Date/time of issue

What you expected to happen

What actually happened

Other Information (sample code, links, etc.)

Getting MessageBodyProviderNotFoundException

[00:49:20] [Craft Scheduler Thread - 1/WARN]: java.util.concurrent.ExecutionException: org.glassfish.jersey.message.internal.MessageBodyProviderNotFoundException: MessageBodyReader not found for media type=application/json;charset=utf-8, type=class pl.zankowski.iextrading4j.api.stocks.Quote, genericType=class pl.zankowski.iextrading4j.api.stocks.Quote.
[00:49:20] [Craft Scheduler Thread - 1/WARN]: 	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
[00:49:20] [Craft Scheduler Thread - 1/WARN]: 	at java.util.concurrent.FutureTask.get(FutureTask.java:192)
[00:49:20] [Craft Scheduler Thread - 1/WARN]: 	at com.tchristofferson.stocks.commands.StocksCommand.lambda$check$6(StocksCommand.java:208)
[00:49:20] [Craft Scheduler Thread - 1/WARN]: 	at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftTask.run(CraftTask.java:81)
[00:49:20] [Craft Scheduler Thread - 1/WARN]: 	at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54)
[00:49:20] [Craft Scheduler Thread - 1/WARN]: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[00:49:20] [Craft Scheduler Thread - 1/WARN]: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[00:49:20] [Craft Scheduler Thread - 1/WARN]: 	at java.lang.Thread.run(Thread.java:745)
[00:49:20] [Craft Scheduler Thread - 1/WARN]: Caused by: org.glassfish.jersey.message.internal.MessageBodyProviderNotFoundException: MessageBodyReader not found for media type=application/json;charset=utf-8, type=class pl.zankowski.iextrading4j.api.stocks.Quote, genericType=class pl.zankowski.iextrading4j.api.stocks.Quote.
[00:49:20] [Craft Scheduler Thread - 1/WARN]: 	at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$TerminalReaderInterceptor.aroundReadFrom(ReaderInterceptorExecutor.java:208)
[00:49:20] [Craft Scheduler Thread - 1/WARN]: 	at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor.proceed(ReaderInterceptorExecutor.java:132)
[00:49:20] [Craft Scheduler Thread - 1/WARN]: 	at org.glassfish.jersey.message.internal.MessageBodyFactory.readFrom(MessageBodyFactory.java:1067)
[00:49:20] [Craft Scheduler Thread - 1/WARN]: 	at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:850)
[00:49:20] [Craft Scheduler Thread - 1/WARN]: 	at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:810)
[00:49:20] [Craft Scheduler Thread - 1/WARN]: 	at org.glassfish.jersey.client.ClientResponse.readEntity(ClientResponse.java:339)
[00:49:20] [Craft Scheduler Thread - 1/WARN]: 	at org.glassfish.jersey.client.InboundJaxrsResponse$2.call(InboundJaxrsResponse.java:102)
[00:49:20] [Craft Scheduler Thread - 1/WARN]: 	at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
[00:49:20] [Craft Scheduler Thread - 1/WARN]: 	at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
[00:49:20] [Craft Scheduler Thread - 1/WARN]: 	at org.glassfish.jersey.internal.Errors.process(Errors.java:205)
[00:49:20] [Craft Scheduler Thread - 1/WARN]: 	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:365)
[00:49:20] [Craft Scheduler Thread - 1/WARN]: 	at org.glassfish.jersey.client.InboundJaxrsResponse.runInScopeIfPossible(InboundJaxrsResponse.java:240)
[00:49:20] [Craft Scheduler Thread - 1/WARN]: 	at org.glassfish.jersey.client.InboundJaxrsResponse.readEntity(InboundJaxrsResponse.java:99)
[00:49:20] [Craft Scheduler Thread - 1/WARN]: 	at pl.zankowski.iextrading4j.client.rest.manager.RestManager.executeRequest(RestManager.java:59)
[00:49:20] [Craft Scheduler Thread - 1/WARN]: 	at pl.zankowski.iextrading4j.client.rest.AbstractRestEndpoint.execute(AbstractRestEndpoint.java:16)
[00:49:20] [Craft Scheduler Thread - 1/WARN]: 	at pl.zankowski.iextrading4j.client.rest.endpoint.GenericRestEndpoint.executeRequest(GenericRestEndpoint.java:14)
[00:49:20] [Craft Scheduler Thread - 1/WARN]: 	at pl.zankowski.iextrading4j.client.IEXTradingClient.executeRequest(IEXTradingClient.java:90)
[00:49:20] [Craft Scheduler Thread - 1/WARN]: 	at com.tchristofferson.stocks.Stocks.lambda$getStockData$1(Stocks.java:164)
[00:49:20] [Craft Scheduler Thread - 1/WARN]: 	at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
[00:49:20] [Craft Scheduler Thread - 1/WARN]: 	at java.util.concurrent.FutureTask.run(FutureTask.java)
[00:49:20] [Craft Scheduler Thread - 1/WARN]: 	... 3 more
RestRequest<Quote> request = new QuoteRequestBuilder()
                .withSymbol("aapl")
                .build();
return executorService.submit(() -> {
            try {
                Quote quote = cloudClient.executeRequest(request);//Error happens here
                return new StockData(quote, null);
            } catch (IEXTradingException e) {
                return new StockData(null, e.getMessage());
            }
});

dependencies:

<dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.8.8-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.tchristofferson</groupId>
            <artifactId>API</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.tchristofferson</groupId>
            <artifactId>PersistentStorageAPI</artifactId>
            <version>1.1-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>co.aikar</groupId>
            <artifactId>acf-bukkit</artifactId>
            <version>0.5.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>pl.zankowski</groupId>
            <artifactId>iextrading4j-all</artifactId>
            <version>3.3.2</version>
        </dependency>
        <dependency>
            <groupId>com.github.MilkBowl</groupId>
            <artifactId>VaultAPI</artifactId>
            <version>1.7</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

ClassCastException related to javax.ws.rs-api dependency

Describe the bug
After upgrading Spring Boot from version 2.7 to version 3.2, I'm running into
ClassCastException: attempting to castjar:file:/app/libs/javax.ws.rs-api-2.1.1.jar!/javax/ws/rs/client/ClientBuilder.class to jar:file:/app/libs/javax.ws.rs-api-2.1.1.jar!/javax/ws/rs/client/ClientBuilder.clas exception. After searching it up, upgrading this library would solve the problem. I noticed that library was upgraded in #124 but changes were reverted with #133.

To Reproduce
Steps to reproduce the behavior:

  1. Use Spring Boot 3.2, Java 17
  2. Execute IEXCloudClient create(IEXTradingApiVersion version, IEXCloudToken token) method

Expected behavior
Expecting method to return IEXTradingClient instance

BatchMarketStocksRequestBuilder doesn't allow to add a range parameter for chart type

With ChartRequestBuilder I'm able to use withChartRange(ChartRange range).

I would expect to be able to use the same parameter with BatchMarketStocksRequestBuilder as well, since it is supported by the batch market end point of IEX (https://iextrading.com/developer/docs/#batch-requests).
As the documentation states:

range

  • OptionalΒ 
  • Used to specify a chart range ifΒ chartΒ is used inΒ typesΒ parameter.

I'm using the latest version 2.2.4.

I think usage should be the same, like the following:

final IEXTradingClient iexTradingClient = IEXTradingClient.create();
final BatchMarketStocksRequestBuilder batchRequest = new BatchMarketStocksRequestBuilder()
				.addType(BatchStocksType.CHART)
                                .withChartRange(ChartRange.THREE_MONTHS);
		
		for (String symbol : symbols) {
			batchRequest.withSymbol(symbol);
		}
		
		Map<String, BatchStocks> batchResult = iexTradingClient.executeRequest(batchRequest
				.build());

Batch API

Summary

Hi Wojciech,

Is the market/batch IEXTrading API implemented? It doesn't seem to be there.

I want to do: /stock/market/batch?symbols=aapl,fb,tsla&types=price

Thanks!!!!

Mike (hpdrago)

Details

Date/time of issue

What you expected to happen

What actually happened

Other Information (sample code, links, etc.)

java.lang.reflect.InvocationTargetException: null

Describe the bug
The first time I execute a request using the IEXTradingClient, it throws this exception. Subsequent requests do not throw the same exception. Regardless of whether the exception is thrown, the request succeeds. I'm utilizing the SymbolsRequestBuilder though i don't think that matters. This is being triggered in a Spring Boot application by running as a Java process, not in an application server.

To Reproduce
Steps to reproduce the behavior:
final IEXTradingClient iexTradingClient = IEXTradingClient.create(); final List<ExchangeSymbol> exchangeSymbolList = iexTradingClient.executeRequest(new SymbolsRequestBuilder().build());
Review log output (stack trace)

Expected behavior
No exception in log output

Additional context
The request is triggered by a REST endpoint @Async Resource handler.

Technical Indicators Returning Null

Summary

Getting data from Technical Indicators are returning null values for me.

Details

Date/time of issue

1/15/21

What you expected to happen

Getting technical indicator data.

What actually happened

Getting a list of nulls.

Other Information (sample code, links, etc.)

        TechnicalIndicator stoch = cloudClient.executeRequest(new TechnicalIndicatorRequestBuilder()
                .withTechnicalIndicatorType(TechnicalIndicatorType.STOCH)
                .withRange(ChartRange.FIVE_DAYS)
                .withInput1(new BigDecimal(14))
                .withInput2(new BigDecimal(3))
                .withInput3(new BigDecimal(3))
                .withSymbol("EA")
                .build());

        TechnicalIndicator rsi = cloudClient.executeRequest(new TechnicalIndicatorRequestBuilder()
                .withTechnicalIndicatorType(TechnicalIndicatorType.RSI)
                .withRange(ChartRange.FIVE_DAYS)
                .withInput1(new BigDecimal(7))
                .withSymbol("EA")
                .build());

        TechnicalIndicator macd = cloudClient.executeRequest(new TechnicalIndicatorRequestBuilder()
                .withTechnicalIndicatorType(TechnicalIndicatorType.MACD)
                .withRange(ChartRange.FIVE_DAYS)
                .withSymbol("EA")
                .build());

        System.out.println("stoch = " + stoch.getIndicator());
        System.out.println("rsi = " + rsi.getIndicator());
        System.out.println("macd = " + macd.getIndicator());

Returns the following:

stoch = [[null, null, null, null, null], [null, null, null, null, null]]
rsi = [[null, null, null, null, null]]
macd = [[null, null, null, null, null], [null, null, null, null, null], [null, null, null, null, null]]

EarningsRequestBuilder requestWithLast path is missing the {last}

Describe the bug
Requests to IEX using the EarningsRequestbuilder while specifying the last argument don't include the argument in the URL when calling IEX. This results in only 1 earnings record being returned (which is the IEX default if no "last" value is specified).

To Reproduce
Steps to reproduce the behavior:

  1. Construct an earnings request similar to:
        Earnings earnings = iexCloudClient.executeRequest(new EarningsRequestBuilder()
                .withSymbol(symbol)
                .withLast(4)
                .build());

Expected behavior
Result returns 4 quarters of earnings history.

According to the IEX API spec (https://iexcloud.io/docs/api/#earnings), the fix is to modify line 23 of EarningsRequestBuilder.java from:

.withPath("/stock/{symbol}/earnings")
to include the "last" argument in the url as a path param:

.withPath("/stock/{symbol}/earnings/{last}")

getStocksEndpoint does not exist

Hello,

I am interested in trying your API out for IEX trading. I want to get the current stock price and I see that the current version in Maven doesn't have a reference to getStockEndPoint(). I see in your code that you created it and the method to get the endpoint is public.

stocksEndpoint = new StocksEndpointImpl(getRESTClient(), getBaseApiUrl());

Thanks,
Mike.

ChartRequestBuilder() produces Charts containing null values

Code below produces Charts with public fields containing "null" values,
while private fields contain correct values.

IEXTradingClient tradingClient;
List<Chart> chartList = tradingClient.executeRequest(new ChartRequestBuilder()
                .withChartRange(ChartRange.ONE_MONTH)
                .withSymbol("IBM")
                .build());

chartList.get(0).getMarketClose() returns null

Code obtained from your examples.

From debugger:
github_issue

Failed to parse HIST response for multiple days

Describe the bug
When requesting HIST without date parameter it returns Map instead of List. Because if the response cannot be parsed by library.

To Reproduce
Steps to reproduce the behavior:

  1. Request HIST without parameters
final List<HIST> histList = iexTradingClient.executeRequest(new HistRequestBuilder()
                .build());
  1. Library fails to parse reponse

Expected behavior
It should parse response to Map.

Trying to start with iextrading4j in Eclipse Kepler with Java 8

Summary

I downloaded iextrading4j from Github and imported the code into a fresh new Eclipse Java project.

Details

There were so many errors that made me believe I was using the code wrongly in my project. So I have to ask, what is the workflow for importing or using iextrading4j in Eclipse?

Date/time of issue

What you expected to happen

I want to start using the iextrading4j code without any hassle. I have tried resolving all the dependencies but they are far too many. I am also new to Maven so that is also a problem for me. I am using Java 8 SE and Eclipse Kepler

What actually happened

Other Information (sample code, links, etc.)

I am proficient in core Java.

iextrading4j

Illegal argument exception thrown if the symbol has '$' symbol

Describe the bug
A new symbol is added as 'JNJ$', that's why RestManager.java now throws IllegalArgumentException

To Reproduce
Steps to reproduce the behavior:

  1. Request for key stats (as an example, the others also have the same problem) with the symbol 'JNJ$'
  2. IllegalArgumentException will be thrown afterward from RestManager.java

Expected behavior
IllegalArgumentException won't be thrown and the response will be parsed successfully

Additional context
Caused by: java.lang.IllegalArgumentException: Illegal group reference: group index is missing
at java.base/java.util.regex.Matcher.appendExpandedReplacement(Unknown Source)
at java.base/java.util.regex.Matcher.appendReplacement(Unknown Source)
at java.base/java.util.regex.Matcher.replaceFirst(Unknown Source)
at java.base/java.lang.String.replaceFirst(Unknown Source)
at pl.zankowski.iextrading4j.client.rest.manager.RestManager.createPath(RestManager.java:94)
at pl.zankowski.iextrading4j.client.rest.manager.RestManager.createURL(RestManager.java:73)
at pl.zankowski.iextrading4j.client.rest.manager.RestManager.executeRequest(RestManager.java:30)
at pl.zankowski.iextrading4j.client.rest.AbstractRestEndpoint.execute(AbstractRestEndpoint.java:16)
at pl.zankowski.iextrading4j.client.rest.endpoint.GenericRestEndpoint.executeRequest(GenericRestEndpoint.java:14)

image

DeepSseRequestBuilder sse streaming data comes as Array - deserialization error

Describe the bug
Attempting to stream DEEP data gives Cannot deserialize error .

To Reproduce

	final IEXCloudClient cloudClient = IEXTradingClient.create(IEXTradingApiVersion.IEX_CLOUD_BETA_SANDBOX,
			new IEXCloudTokenBuilder().withPublishableToken("Tpk_18dfe6cebb4f41ffb219b9680f9acaf2")
					.withSecretToken("Tsk_3eedff6f5c284e1a8b9bc16c54dd1af3").build());
    final String symbol = "IBM";
    final Consumer<DeepAsyncResponse<DeepResult>> deepConsumer = System.out::println;

    final SseRequest<DeepAsyncResponse<DeepResult>> request = new DeepSseRequestBuilder()
            .withSymbol(symbol)
            .build();
	
    cloudClient.subscribe(request, deepConsumer);

Expected behavior
Expected to see streaming data

Screenshots

Jul 15, 2019 12:30:28 PM org.glassfish.jersey.media.sse.internal.JerseySseEventSource lambda$static$1
WARNING: Subscriber.onError() called on subscriber with no registered error handler.
javax.ws.rs.ProcessingException: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `pl.zankowski.iextrading4j.client.socket.request.marketdata.deep.DeepAsyncResponse` out of START_ARRAY token
 at [Source: (ByteArrayInputStream); line: 1, column: 1]
	at org.glassfish.jersey.media.sse.InboundEvent.readAndCast(InboundEvent.java:373)
	at org.glassfish.jersey.media.sse.InboundEvent.readData(InboundEvent.java:359)
	at pl.zankowski.iextrading4j.client.sse.manager.SseManager.lambda$0(SseManager.java:38)
	at org.glassfish.jersey.media.sse.internal.JerseySseEventSource$1.onNext(JerseySseEventSource.java:146)
	at org.glassfish.jersey.media.sse.internal.JerseySseEventSource$1.onNext(JerseySseEventSource.java:128)
	at org.glassfish.jersey.internal.util.JerseyPublisher$SubscriberWrapper.onNext(JerseyPublisher.java:391)
	at org.glassfish.jersey.internal.jsr166.SubmissionPublisher$BufferedSubscription.consume(SubmissionPublisher.java:1500)
	at org.glassfish.jersey.internal.jsr166.SubmissionPublisher$ConsumerTask.run(SubmissionPublisher.java:953)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `pl.zankowski.iextrading4j.client.socket.request.marketdata.deep.DeepAsyncResponse` out of START_ARRAY token
 at [Source: (ByteArrayInputStream); line: 1, column: 1]
	at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:63)
	at com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1343)
	at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1139)
	at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1093)
	at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromArray(BeanDeserializerBase.java:1461)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:185)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:161)
	at com.fasterxml.jackson.databind.ObjectReader._bind(ObjectReader.java:1574)
	at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:965)
	at org.glassfish.jersey.jackson.internal.jackson.jaxrs.base.ProviderBase.readFrom(ProviderBase.java:838)
	at org.glassfish.jersey.media.sse.InboundEvent.readAndCast(InboundEvent.java:365)
	... 12 more

Additional context
Add any other context about the problem here.

JDK 11 support aka update glassfish jersey

Right now it is not possible to use iextrading4j in JDK 11 or lower due to a bug in of the dependent libraries that was used (although not all features impacted by this).

The exception that will be thrown is:

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/glassfish/jersey/internal/jsr166/SubmissionPublisherFactory has been compiled by a more recent version of the Java Runtime (class file version 56.0), this version of the Java Runtime only recognizes class file versions up to 55.0
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	at org.glassfish.jersey.internal.util.JerseyPublisher.<init>(JerseyPublisher.java:44)
	at org.glassfish.jersey.media.sse.internal.JerseySseEventSource.<init>(JerseySseEventSource.java:91)
	at org.glassfish.jersey.media.sse.internal.JerseySseEventSource.<init>(JerseySseEventSource.java:39)
	at org.glassfish.jersey.media.sse.internal.JerseySseEventSource$Builder.build(JerseySseEventSource.java:222)
	at org.glassfish.jersey.media.sse.internal.JerseySseEventSource$Builder.build(JerseySseEventSource.java:199)
	at pl.zankowski.iextrading4j.client.sse.manager.SseManager.subscribe(SseManager.java:29)
	at pl.zankowski.iextrading4j.client.sse.endpoint.GenericSseEndpoint.subscribe(GenericSseEndpoint.java:19)
	at pl.zankowski.iextrading4j.client.IEXTradingClient.subscribe(IEXTradingClient.java:101)
	at org.roboquant.feeds.iex.IEXLive.subscribeTrades(IEXLive.kt:83)
	at org.roboquant.MainKt.feedIEXLive(main.kt:77)
	at org.roboquant.MainKt.main(main.kt:105)
	at org.roboquant.MainKt.main(main.kt)

BTW, the mentioned class file version 56 is JDK 12

The is a bug in glassfish jersey. If you would update the dependency in the pom from 2.30 to 2.30.1 they fixed it.

 <dependency>
           <groupId>org.glassfish.jersey.core</groupId>
           <artifactId>jersey-common</artifactId>
           <version>2.30.1</version>
  </dependency>

I put the above also in my own pom file to force to load this instead of 2.30 and indeed the exception goes away.

P.S iextrading4j is very nice library, I use it in an algo-trading framework written in Kotlin called roboquant.

IEX Deprecating old api

Is your feature request related to a problem? Please describe.
As of June 1, 2019, The API implemented by this library will be deprecated and retired. A notice confirming this can be found here as of the time of this posting. https://iextrading.com/developer/. Additionally, they will be requiring API keys and adding pay-for options.

Describe the solution you'd like
I would like to see the library upgraded to handle the new API along with adding some features to protect against charges from the API.

Describe alternatives you've considered
Forking/starting a similar project to conform to and adapt to the new API.

Additional context
n/a

request of ref-data/symbols gets error in iexId type

Describe the bug
Trying to get all the symbols in IEX,
specifically BRK.A
in https://api.iextrading.com/1.0/ref-data/symbols it does not return
in https://cloud.iexapis.com/stable/ref-data/symbols it returns

To Reproduce
im am trying this way:
final IEXCloudClient cloudClient = IEXTradingClient.create(IEXTradingApiVersion.IEX_CLOUD_V1,
new IEXCloudTokenBuilder()
.withPublishableToken("-")
.build());
final List exchangeSymbolList = cloudClient.executeRequest(new SymbolsRequestBuilder()
.build());

but I am getting:
Caused by: com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type java.lang.Long from String "IEX_46574843354B2D52": not a valid Long value
at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 1, column: 177] (through reference chain: java.util.ArrayList[0]->pl.zankowski.iextrading4j.api.refdata.ExchangeSymbol["iexId"])

in all API iexId is a String in this one class it is Long

The last developer in my company used this implementation, bellow:

private final IEXApiClient iexTradingClient = IEXTradingClient.create();

to execute the request, but Using this the API goes by DEFAULT to IEXTradingApiVersion.IEX_API_V1
and as I stated above does not return BRK.A, but the implementation WORKS just fine

For SSE streaming of Sentiment, the JSON response schema is not correct.

In iexcloud docs: https://iexcloud.io/docs/api/#social-sentiment, the schema for rest request of sentiment is different from the sse response. But in the sentiment sample code: https://github.com/WojciechZankowski/iextrading4j/blob/master/iextrading4j-samples/src/main/java/pl/zankowski/iextrading4j/sample/iexcloud/sse/SseAlternativeSample.java, the SentimentSseRequestBuilder is returning response of SseRequest<List>. This Sentiment class schema does not conform with the fields returned from the stream.
So when you actually run the sample code, you got: [Sentiment{sentiment=null, totalScores=null, positive=null, negative=null, minute=null}].(because nothing matches)
I forked a branch to try to fix this. Please take a look at the code. Thanks!

JacksonSerialization compatibility

Describe the bug
Jackson serialization/deserialization round trip on ExchangeSymbol does not work out of the box. The "isEnabled" field is serialized as "enabled" since the getter is named "getEnabled". This causes an issue when deserializing since the constructor which is used specifies @JsonProperty("isEnabled"). So the issue is that there is an inconsistant naming scheme.

To Reproduce
Serialize an ExchangeSymbol Object then attempt to deserialize the result.

Expected behavior
Serialization/Deserialization round trip should work.

Screenshots
N/A

Additional context
In order to limit requests made to the service Caching data is desired, however since in my application I end up caching large amounts of data for later processing the data must be serialized then later loaded back into memory.

Implementation information :
java version : 11
iextrading4j version : 2.3.0
jackson-databind version : 2.9.7

Note: A workaround for this issue is to configure an object mapper as such :

...
mapper.setVisibility(PropertyAccessor.ALL, Visibility.NONE);
mapper.setVisibility(PropertyAccessor.FIELD, Visibility.ANY);
...

However this is not a great practice and I would like to avoid this.

MessageBodyReader not found

Summary

Hello,

When trying to execute sample code from wiki I've encountered an error.

Error

MessageBodyReader not found for media type=application/json;charset=utf-8, type=interface
java.util.List, genericType=java.util.List<pl.zankowski.iextrading4j.api.stocks.Chart>

Code

final IEXTradingClient iexTradingClient = IEXTradingClient.create();
final List<Chart> chartList = iexTradingClient.executeRequest(new ChartRequestBuilder()
		.withChartRange(ChartRange.ONE_MONTH)
		.withSymbol("AAPL")
		.build());

Version

<dependency>
            <groupId>pl.zankowski</groupId>
            <artifactId>iextrading4j-all</artifactId>
            <version>2.1.8</version>
</dependency>

Jersey exceptions in sysout

Describe the bug
I get multiple jersey error stack traces in my sysout. I still get the desired response (program runs as expected), but in the sysout I get a lot of exceptions displayed.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new simple archetype maven project in Eclipse
  2. Add version 2.2.2 of iextrading4j to the dependencies
  3. Copy & Excecute the code from the quote example code provided in Readme.md

Expected behavior
The only output in sysout should be the string representation of the quote object.

Screenshots
2018-07-04 23_21_39-wstrading - iex_src_test_java_iex_apitests java - eclipse

Additional Information
Am I missing something? Do I need to add more dependencies to the pom.xml like jersey or something?
Sorry, I'm a noob :(

Stack trace:
Juli 04, 2018 9:54:52 NACHM. org.glassfish.jersey.internal.Errors logErrors WARNUNG: The following warnings have been detected: WARNING: HK2 failure has been detected in a code that does not run in an active Jersey Error scope. WARNING: HK2 service reification failed for [org.glassfish.jersey.message.internal.DataSourceProvider] with an exception: MultiException stack 1 of 2 java.lang.NoClassDefFoundError: javax/activation/DataSource at java.base/java.lang.Class.getDeclaredConstructors0(Native Method) at java.base/java.lang.Class.privateGetDeclaredConstructors(Unknown Source) at java.base/java.lang.Class.getDeclaredConstructors(Unknown Source) at org.jvnet.hk2.internal.Utilities$3.run(Utilities.java:1378) at org.jvnet.hk2.internal.Utilities$3.run(Utilities.java:1374) at java.base/java.security.AccessController.doPrivileged(Native Method) at org.jvnet.hk2.internal.Utilities.getAllConstructors(Utilities.java:1374) at org.jvnet.hk2.internal.Utilities.findProducerConstructor(Utilities.java:1317) at org.jvnet.hk2.internal.DefaultClassAnalyzer.getConstructor(DefaultClassAnalyzer.java:83) at org.glassfish.jersey.inject.hk2.JerseyClassAnalyzer.getConstructor(JerseyClassAnalyzer.java:148) at org.jvnet.hk2.internal.Utilities.getConstructor(Utilities.java:180) at org.jvnet.hk2.internal.ClazzCreator.initialize(ClazzCreator.java:129) at org.jvnet.hk2.internal.ClazzCreator.initialize(ClazzCreator.java:180) at org.jvnet.hk2.internal.SystemDescriptor.internalReify(SystemDescriptor.java:740) at org.jvnet.hk2.internal.SystemDescriptor.reify(SystemDescriptor.java:694) at org.jvnet.hk2.internal.ServiceLocatorImpl.reifyDescriptor(ServiceLocatorImpl.java:464) at org.jvnet.hk2.internal.ServiceLocatorImpl.narrow(ServiceLocatorImpl.java:2310) at org.jvnet.hk2.internal.ServiceLocatorImpl.access$1200(ServiceLocatorImpl.java:128) at org.jvnet.hk2.internal.ServiceLocatorImpl$9.compute(ServiceLocatorImpl.java:1395) at org.jvnet.hk2.internal.ServiceLocatorImpl$9.compute(ServiceLocatorImpl.java:1390) at org.glassfish.hk2.utilities.cache.internal.WeakCARCacheImpl.compute(WeakCARCacheImpl.java:128) at org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetAllServiceHandles(ServiceLocatorImpl.java:1452) at org.jvnet.hk2.internal.ServiceLocatorImpl.getAllServiceHandles(ServiceLocatorImpl.java:1377) at org.jvnet.hk2.internal.ServiceLocatorImpl.getAllServiceHandles(ServiceLocatorImpl.java:1366) at org.glassfish.jersey.inject.hk2.AbstractHk2InjectionManager.getAllServiceHolders(AbstractHk2InjectionManager.java:158) at org.glassfish.jersey.inject.hk2.ImmediateHk2InjectionManager.getAllServiceHolders(ImmediateHk2InjectionManager.java:54) at org.glassfish.jersey.internal.inject.Providers.getServiceHolders(Providers.java:329) at org.glassfish.jersey.internal.inject.Providers.getProviders(Providers.java:157) at org.glassfish.jersey.message.internal.MessageBodyFactory.initialize(MessageBodyFactory.java:265) at org.glassfish.jersey.message.internal.MessageBodyFactory$MessageBodyWorkersConfigurator.postInit(MessageBodyFactory.java:136) at org.glassfish.jersey.client.ClientConfig$State.lambda$initRuntime$2(ClientConfig.java:470) at java.base/java.util.Arrays$ArrayList.forEach(Unknown Source) at org.glassfish.jersey.client.ClientConfig$State.initRuntime(ClientConfig.java:470) at org.glassfish.jersey.internal.util.collection.Values$LazyValueImpl.get(Values.java:341) at org.glassfish.jersey.client.ClientConfig.getRuntime(ClientConfig.java:826) at org.glassfish.jersey.client.ClientRequest.getConfiguration(ClientRequest.java:285) at org.glassfish.jersey.client.JerseyInvocation.validateHttpMethodAndEntity(JerseyInvocation.java:143) at org.glassfish.jersey.client.JerseyInvocation.<init>(JerseyInvocation.java:112) at org.glassfish.jersey.client.JerseyInvocation.<init>(JerseyInvocation.java:108) at org.glassfish.jersey.client.JerseyInvocation.<init>(JerseyInvocation.java:99) at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:419) at org.glassfish.jersey.client.JerseyInvocation$Builder.get(JerseyInvocation.java:319) at pl.zankowski.iextrading4j.client.rest.manager.RestManager.executeRequest(RestManager.java:35) at pl.zankowski.iextrading4j.client.rest.AbstractRestEndpoint.execute(AbstractRestEndpoint.java:16) at pl.zankowski.iextrading4j.client.rest.endpoint.GenericRestEndpoint.executeRequest(GenericRestEndpoint.java:14) at pl.zankowski.iextrading4j.client.IEXTradingClient.executeRequest(IEXTradingClient.java:35) at iex.ApiTests.quoteTest(ApiTests.java:20) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:389) at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:115) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:167) at org.junit.jupiter.engine.execution.ThrowableCollector.execute(ThrowableCollector.java:40) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:163) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:110) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:57) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.lambda$execute$3(HierarchicalTestExecutor.java:83) at org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:77) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.lambda$null$2(HierarchicalTestExecutor.java:92) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source) at java.base/java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) at java.base/java.util.Iterator.forEachRemaining(Unknown Source) at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source) at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source) at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.base/java.util.stream.ReferencePipeline.forEach(Unknown Source) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.lambda$execute$3(HierarchicalTestExecutor.java:92) at org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:77) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.lambda$null$2(HierarchicalTestExecutor.java:92) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source) at java.base/java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) at java.base/java.util.Iterator.forEachRemaining(Unknown Source) at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source) at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source) at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.base/java.util.stream.ReferencePipeline.forEach(Unknown Source) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.lambda$execute$3(HierarchicalTestExecutor.java:92) at org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:77) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:51) at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:43) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:170) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:154) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:90) at org.eclipse.jdt.internal.junit5.runner.JUnit5TestReference.run(JUnit5TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206) Caused by: java.lang.ClassNotFoundException: javax.activation.DataSource at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source) at java.base/java.lang.ClassLoader.loadClass(Unknown Source) ... 100 more MultiException stack 2 of 2 java.lang.IllegalArgumentException: Errors were discovered while reifying SystemDescriptor( implementation=org.glassfish.jersey.message.internal.DataSourceProvider contracts={javax.ws.rs.ext.MessageBodyReader,javax.ws.rs.ext.MessageBodyWriter} scope=javax.inject.Singleton qualifiers={} descriptorType=CLASS descriptorVisibility=NORMAL metadata= rank=0 loader=null proxiable=null proxyForSameScope=null analysisName=null id=14 locatorId=0 identityHashCode=2032647583 reified=false) at org.jvnet.hk2.internal.SystemDescriptor.reify(SystemDescriptor.java:705) at org.jvnet.hk2.internal.ServiceLocatorImpl.reifyDescriptor(ServiceLocatorImpl.java:464) at org.jvnet.hk2.internal.ServiceLocatorImpl.narrow(ServiceLocatorImpl.java:2310) at org.jvnet.hk2.internal.ServiceLocatorImpl.access$1200(ServiceLocatorImpl.java:128) at org.jvnet.hk2.internal.ServiceLocatorImpl$9.compute(ServiceLocatorImpl.java:1395) at org.jvnet.hk2.internal.ServiceLocatorImpl$9.compute(ServiceLocatorImpl.java:1390) at org.glassfish.hk2.utilities.cache.internal.WeakCARCacheImpl.compute(WeakCARCacheImpl.java:128) at org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetAllServiceHandles(ServiceLocatorImpl.java:1452) at org.jvnet.hk2.internal.ServiceLocatorImpl.getAllServiceHandles(ServiceLocatorImpl.java:1377) at org.jvnet.hk2.internal.ServiceLocatorImpl.getAllServiceHandles(ServiceLocatorImpl.java:1366) at org.glassfish.jersey.inject.hk2.AbstractHk2InjectionManager.getAllServiceHolders(AbstractHk2InjectionManager.java:158) at org.glassfish.jersey.inject.hk2.ImmediateHk2InjectionManager.getAllServiceHolders(ImmediateHk2InjectionManager.java:54) at org.glassfish.jersey.internal.inject.Providers.getServiceHolders(Providers.java:329) at org.glassfish.jersey.internal.inject.Providers.getProviders(Providers.java:157) at org.glassfish.jersey.message.internal.MessageBodyFactory.initialize(MessageBodyFactory.java:265) at org.glassfish.jersey.message.internal.MessageBodyFactory$MessageBodyWorkersConfigurator.postInit(MessageBodyFactory.java:136) at org.glassfish.jersey.client.ClientConfig$State.lambda$initRuntime$2(ClientConfig.java:470) at java.base/java.util.Arrays$ArrayList.forEach(Unknown Source) at org.glassfish.jersey.client.ClientConfig$State.initRuntime(ClientConfig.java:470) at org.glassfish.jersey.internal.util.collection.Values$LazyValueImpl.get(Values.java:341) at org.glassfish.jersey.client.ClientConfig.getRuntime(ClientConfig.java:826) at org.glassfish.jersey.client.ClientRequest.getConfiguration(ClientRequest.java:285) at org.glassfish.jersey.client.JerseyInvocation.validateHttpMethodAndEntity(JerseyInvocation.java:143) at org.glassfish.jersey.client.JerseyInvocation.<init>(JerseyInvocation.java:112) at org.glassfish.jersey.client.JerseyInvocation.<init>(JerseyInvocation.java:108) at org.glassfish.jersey.client.JerseyInvocation.<init>(JerseyInvocation.java:99) at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:419) at org.glassfish.jersey.client.JerseyInvocation$Builder.get(JerseyInvocation.java:319) at pl.zankowski.iextrading4j.client.rest.manager.RestManager.executeRequest(RestManager.java:35) at pl.zankowski.iextrading4j.client.rest.AbstractRestEndpoint.execute(AbstractRestEndpoint.java:16) at pl.zankowski.iextrading4j.client.rest.endpoint.GenericRestEndpoint.executeRequest(GenericRestEndpoint.java:14) at pl.zankowski.iextrading4j.client.IEXTradingClient.executeRequest(IEXTradingClient.java:35) at iex.ApiTests.quoteTest(ApiTests.java:20) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:389) at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:115) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:167) at org.junit.jupiter.engine.execution.ThrowableCollector.execute(ThrowableCollector.java:40) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:163) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:110) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:57) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.lambda$execute$3(HierarchicalTestExecutor.java:83) at org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:77) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.lambda$null$2(HierarchicalTestExecutor.java:92) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source) at java.base/java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) at java.base/java.util.Iterator.forEachRemaining(Unknown Source) at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source) at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source) at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.base/java.util.stream.ReferencePipeline.forEach(Unknown Source) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.lambda$execute$3(HierarchicalTestExecutor.java:92) at org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:77) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.lambda$null$2(HierarchicalTestExecutor.java:92) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source) at java.base/java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) at java.base/java.util.Iterator.forEachRemaining(Unknown Source) at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source) at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source) at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.base/java.util.stream.ReferencePipeline.forEach(Unknown Source) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.lambda$execute$3(HierarchicalTestExecutor.java:92) at org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:77) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:51) at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:43) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:170) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:154) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:90) at org.eclipse.jdt.internal.junit5.runner.JUnit5TestReference.run(JUnit5TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)

Broken Dividends Endpoint since IEX 12/01 upgrade

Describe the bug
Dividends endpoint and many others endpoint broken since IEX 12/01/2020 upgrade.

Caused by: com.fasterxml.jackson.databind.JsonMappingException: Invalid value for Year (valid values -999999999 - 999999999): 4203587259 (through reference chain: java.util.ArrayList[0]->pl.zankowski.iextrading4j.api.stocks.v1.Dividends["date"])

To Reproduce
Steps to reproduce the behavior:

// symbol = AAPL
final List<pl.zankowski.iextrading4j.api.stocks.v1.Dividends> dividends = cloudClient.executeRequest(new DividendsRequestBuilder()
.withSymbol(syb.getSymbol())
.withDividendRange(DividendRange.FIVE_YEARS)
.build());
Expected behavior
return java object

Support for SSE quotes without UTP

Currently the implementation for SSE quotes, QuoteSseRequestBuilder, only supports endpoints that require you to have a Nasdaq UTP Vendor Agreement, including stocksUS1Second, stocksUS5Second, and stocksUS1Minute. Citing directly from the IEX API docs:

IEX Cloud provides real time prices, volume, and quotes for all NMS US securities; sourced from the Investors Exchange. In order to receive DELAYED Nasdaq-listed security data through this endpoint Nasdaq UTP requires you to complete a Vendor Agreement. Delayed prices include open, close, extended hours prices, and other derived values. All users will continue to receive real time Investors Exchange data for free. DELAYED NYSE listed symbols are only available to paid users due to reporting requirements.

If you don't have a Vendor Agreement, these endpoints all return a HTTP 451. As a result, IEX supplies equivalent endpoints that don't require UTP, but the Nasdaq data comes from Investors Exchange's data directly and not from consolidated tape. These three endpoints are stocksUSNoUTP1Second, stocksUSNoUTP5Second, and stocksUSNoUTP1Minute. The QuoteSseRequestBuilder class should provide a method, something like QuoteSseRequestBuilder#withNoUTP, to change the endpoint URL to support this functionality.

TOPS Streaming data comes as Array - deserialization error

Describe the bug
When executing sample code I get a deserialize error

To Reproduce
Use sample code

	final IEXCloudClient cloudClient = IEXTradingClient.create(IEXTradingApiVersion.IEX_CLOUD_BETA_SANDBOX,
			new IEXCloudTokenBuilder().withPublishableToken("Tpk_18dfe6cebb4f41ffb219b9680f9acaf2")
					.withSecretToken("Tsk_3eedff6f5c284e1a8b9bc16c54dd1af3").build());

	final Consumer<TOPS> TOPS_CONSUMER = System.out::println;
	final SseRequest<TOPS> request = new TopsSseRequestBuilder().withSymbol("spy").build();

	cloudClient.subscribe(request, TOPS_CONSUMER);

See error:

Jul 12, 2019 12:57:51 PM org.glassfish.jersey.media.sse.internal.JerseySseEventSource lambda$static$1
WARNING: Subscriber.onError() called on subscriber with no registered error handler.
javax.ws.rs.ProcessingException: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `pl.zankowski.iextrading4j.api.marketdata.TOPS` out of START_ARRAY token
 at [Source: (ByteArrayInputStream); line: 1, column: 1]
	at org.glassfish.jersey.media.sse.InboundEvent.readAndCast(InboundEvent.java:373)
	at org.glassfish.jersey.media.sse.InboundEvent.readData(InboundEvent.java:359)
	at pl.zankowski.iextrading4j.client.sse.manager.SseManager.lambda$0(SseManager.java:38)
	at org.glassfish.jersey.media.sse.internal.JerseySseEventSource$1.onNext(JerseySseEventSource.java:146)
	at org.glassfish.jersey.media.sse.internal.JerseySseEventSource$1.onNext(JerseySseEventSource.java:128)
	at org.glassfish.jersey.internal.util.JerseyPublisher$SubscriberWrapper.onNext(JerseyPublisher.java:391)
	at org.glassfish.jersey.internal.jsr166.SubmissionPublisher$BufferedSubscription.consume(SubmissionPublisher.java:1500)
	at org.glassfish.jersey.internal.jsr166.SubmissionPublisher$ConsumerTask.run(SubmissionPublisher.java:953)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `pl.zankowski.iextrading4j.api.marketdata.TOPS` out of START_ARRAY token
 at [Source: (ByteArrayInputStream); line: 1, column: 1]
	at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:63)
	at com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1343)
	at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1139)
	at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1093)
	at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromArray(BeanDeserializerBase.java:1461)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:185)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:161)
	at com.fasterxml.jackson.databind.ObjectReader._bind(ObjectReader.java:1574)
	at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:965)
	at org.glassfish.jersey.jackson.internal.jackson.jaxrs.base.ProviderBase.readFrom(ProviderBase.java:838)
	at org.glassfish.jersey.media.sse.InboundEvent.readAndCast(InboundEvent.java:365)
	... 12 more

Expected behavior
Expect to see quotes, e.g.

 {"symbol":"SPY","companyName":"SPDR S&P 500 ETF Trust","calculationPrice":"tops","open":299.86,"openTime":1562938200171,"close":299.31,"closeTime":1562875200166,"high":300.5,"low":299.51,"latestPrice":300.55,"latestSource":"IEX real time price","latestTime":"3:53:23 PM","latestUpdate":1562961203133,"latestVolume":31681768,"iexRealtimePrice":300.55,"iexRealtimeSize":1,"iexLastUpdated":1562961203133,"delayedPrice":300.48,"delayedPriceTime":1562960307776,"extendedPrice":299.85,"extendedChange":-0.7,"extendedChangePercent":-0.00233,"extendedPriceTime":1562938200341,"previousClose":299.31,"change":1.24,"changePercent":0.00414,"iexMarketPercent":0.021848244075267517,"iexVolume":692191,"avgTotalVolume":63981281,"iexBidPrice":300.54,"iexBidSize":500,"iexAskPrice":300.56,"iexAskSize":1000,"marketCap":0,"peRatio":null,"week52High":300.55,"week52Low":233.76,"ytdChange":0.200519,"lastTradeTime":1562961203133}

IEXCloud discontinued

Summary

IEXCloud is discontinuing their service on August 31st. Does anybody know an alternative service with a compatible API?

Details

Date/time of issue

What you expected to happen

What actually happened

Other Information (sample code, links, etc.)

Cannot get one-day chart

Summary

I tried to run this example with a range of 1 day but I got an exception: https://github.com/WojciechZankowski/iextrading4j/wiki/Chart

Details

My code is:
final IEXTradingClient iexTradingClient = IEXTradingClient.create();
final List<Chart> chartList = iexTradingClient.executeRequest(new ChartRequestBuilder().withChartRange(ChartRange.ONE_DAY).withSymbol("AAPL").build());

What you expected to happen

Get this data:
https://api.iextrading.com/1.0/stock/aapl/chart/1d

What actually happened

com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "marketOpen" (class pl.zankowski.iextrading4j.api.stocks.Chart), not marked as ignorable (24 known properties: "notional", "marketAverage", "high", "open", "marketNumberOfTrades", "marketChangeOverTime", "date", "numberOfTrades", "change", "changeOverTime", "minute", "changePercent", "marketVolume", "marketLow", "volume", "marketNotional", "average", "marketHigh", "unadjustedVolume", "vwap", "low", "close", "label", "simplifyFactor"])

UsageRequestBuilder requires usage type

Describe the bug
The UsageRequestBuilder requires a usage type in order to work correctly. The build method throws a null pointer exception if a type was not specified. The API does not require this type. The functionality when not provided is to return all types.

To Reproduce
Steps to reproduce the behavior:

  1. execute :
    iexTradingClient.executeRequest(new UsageRequestBuilder().build());
    with a configured client
  2. See null pointer error:
Caused by: java.lang.NullPointerException: null
	at pl.zankowski.iextrading4j.client.rest.request.account.UsageRequestBuilder.build(UsageRequestBuilder.java:25) ~[iextrading4j-client-3.0.0.jar:na]

Expected behavior
The request builder should allow for the parameter to be omitted.
Screenshots
N/A

Additional context
N/A

How does the new websocket for TOP work?

Summary

TOP TopsAsyncRequestBuilder works until yesterday (2019-06-17), Today is not working:

    final IEXTradingClient iexTradingClient = IEXTradingClient.create();
    final Consumer<TOPS> TOPS_CONSUMER = this::doTradingTops;
    final SocketRequest<TOPS> request = new TopsAsyncRequestBuilder()
            .withAllSymbols()
            .build();
    iexTradingClient.unsubscribe(request);
    iexTradingClient.subscribe(request, TOPS_CONSUMER);

How does the new websocket for TOP work?

Details

Date/time of issue

2019-06-18

What you expected to happen

Websocket works

What actually happened

Websocket dont return anything

Other Information (sample code, links, etc.)

ChartRequestBuilder() fails with IEXCloudClient (map casting issue)

Describe the bug
I am trying to use ChartRequestBuilder() with the IEXCloudClient, but whenever I do so, I get this error:

Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: org/glassfish/jersey/internal/l10n/LocalizableMessageFactory$ResourceBundleSupplier

Stepping through my debugger, I see this message:

((com.google.common.collect.SingletonImmutableBiMap)request.queryParams).entrySet().toArray()[0]
 = Cannot cast 'com.google.common.collect.RegularImmutableMap' to 'com.google.common.collect.SingletonImmutableBiMap'

To Reproduce
Create a new IEXCloudClient, like so:

private final IEXCloudClient iexTradingClient = IEXTradingClient.create(IEXTradingApiVersion.IEX_CLOUD_V1,
        new IEXCloudTokenBuilder()
            .withPublishableToken("{publishable token}")
            .build());

Below that, try the following code:

RestRequest<List<Chart>> request = new ChartRequestBuilder()
    .withSymbol("VOO").withChartRange(ChartRange.ONE_DAY).build();
final List<Chart> chartList = iexTradingClient.executeRequest(request);

Note: This is the request in question when in the debugger I see

Cannot cast 'com.google.common.collect.RegularImmutableMap' to 'com.google.common.collect.SingletonImmutableBiMap'

Expected behavior
To successfully have my iexTradingClient (an instance of IEXCloudClient) successfully return a List<Chart>.

Additional context
When debugging, I've noticed that the URL that is generated in pl.zankowski.iextrading4j.client.rest.manager.RestManager (which is https://cloud.iexapis.com/v1/stock/VOO/chart/1d?token={publishable key}) is successful in Postman, indicating that both my token and the built endpoint are correct.

Result returned from Batch news has encoding problem

The following is the code that i used to run:

iexCloudClient
                    .executeRequest(
                         new BatchMarketStocksRequestBuilder()
                            .addType(BatchStocksType.NEWS)
                            .withSymbol("AMD")
                            .withLast(1)
                            .build()

Got the following:
news=[News{datetime=1628190347774, headline=afoa(3Oen2 ai ,nalAi,IPAnccCirsoe iMbnia i adnpTecdetc ot o u on eEca ns,i A nLm utoametneb0,o sprAhtAeold bIlNt wdNn sorneMsBr)D$aCilcZk rpoodrg, source= seiiIssudanrsesMBer ktn, url=i//8ov61s-bsrc6/aauao5.tc4//tet8457li59p4/mlee08ca-bh9-.nbea90f4s9:i-x7pcedwd7, summary=ssl ysnfs$eth er o vlt meerg oe n o CiLahrhr xrlyda.oeinc sre otr aorhncianmsosceiilutn-oeifite76desbnfhu mobsth$hmGnsvDrtyrrsn 'pi2ohmnr ca Prxsuet 0n t oe atl. tPo r f hinsaauaeafs wtnogo sorfrdvlforttnrAb a awtnadPtotsa,iIo nr,a a- ertnoti-r,....

I've tested that the batch API call using postman is fine.
Any idea?

NPE when trying to get a symbol list

Back in March, I had a program using the 2.3.0 version of iextrading4j that worked perfectly.

I hadn't run it for a long time, then tried it again a few days ago. It didn't work, and research revealed that IEX changed their API.

So I upgraded to the latest version of iextrading4j and set about fixing the code.

I am now creating the client like this:

	private static final IEXCloudClient iexClient = IEXTradingClient.create(new IEXCloudTokenBuilder()
            .withPublishableToken(IEX_PUBLISH_TOKEN)
            .withSecretToken(IEX_SECRET_TOKEN)
            .build());

And I am trying to get the symbol list like this:

		List<ExchangeSymbol> foundIexSymbols = iexClient.executeRequest(new ExchangeSymbolsRequestBuilder()
				.build());

Both of those code pieces needed changing when I upgraded. With that code, I get NPE:

Exception in thread "main" java.lang.NullPointerException: null value in entry: exchange=null
	at com.google.common.collect.CollectPreconditions.checkEntryNotNull(CollectPreconditions.java:32)
	at com.google.common.collect.SingletonImmutableBiMap.<init>(SingletonImmutableBiMap.java:42)
	at com.google.common.collect.ImmutableBiMap.of(ImmutableBiMap.java:71)
	at com.google.common.collect.ImmutableMap.of(ImmutableMap.java:123)
	at com.google.common.collect.ImmutableMap.copyOf(ImmutableMap.java:457)
	at com.google.common.collect.ImmutableMap.copyOf(ImmutableMap.java:436)
	at pl.zankowski.iextrading4j.api.util.MapUtil.immutableMap(MapUtil.java:15)
	at pl.zankowski.iextrading4j.client.rest.manager.RestRequest.<init>(RestRequest.java:32)
	at pl.zankowski.iextrading4j.client.rest.manager.RestRequestBuilder.build(RestRequestBuilder.java:102)
	at pl.zankowski.iextrading4j.client.rest.request.refdata.v1.ExchangeSymbolsRequestBuilder.build(ExchangeSymbolsRequestBuilder.java:29)
	at tristar.plieades.stocknotify.stock.StockSymbols.getAllUpdates(StockSymbols.java:139)
	at tristar.plieades.stocknotify.stock.StockSymbols.updateSymbolsFromApi(StockSymbols.java:110)
	at tristar.plieades.stocknotify.stock.StockSymbols.init(StockSymbols.java:68)
	at tristar.plieades.stocknotify.StockNotifyApplication.main(StockNotifyApplication.java:52)

Have I done something wrong, or is it a bug? I'm thinking probably bug, but maybe I should have done something different.

Chart don't work for many stock - return only null values (AAPL) - since 12/01 upgrade.

Describe the bug
AAPL chart return null value for many dates since 12/01 upgrade

To Reproduce
call chart AAPL for 2020-12-29 or any 2020

Expected behavior
chart show correct values

Additional context
final List<pl.zankowski.iextrading4j.api.stocks.Chart> chartList = cloudClient.executeRequest(new ChartRequestBuilder()
.withDate(idPoint)
.withSymbol("AAPL")
.build());

Invalid 'marketAverage' Values (-1) In 1d Chart

Describe the bug
marketAverage (and occasionally average) sometimes returns a value of -1 when querying a chart for a given date.

To Reproduce
Steps to reproduce the behavior:

  1. Copy the Java code below.
  2. Observe which times of the day (2018-05-29 for this example) have a marketAverage of -1.
  3. Compare the value from the JSON supplied in the stocks endpoint at the same time of the same day ("/stock/aapl/chart/date/20180529" in this example). It is not -1 in the JSON.

Expected behavior
The values for average and marketAverage in the Chart class of this Java API should always match the corresponding values from the direct JSON API.

Screenshots
N/A

Additional context
Code to reproduce:

IEXTradingClient client = IEXTradingClient.create();
List<Chart> chartList = client.executeRequest(new ChartRequestBuilder()
                .withSymbol("AAPL")
                .withChartRange(ChartRange.ONE_DAY)
                .withDate(LocalDate.of(2018, 5, 29))
                .build());
 
for (int i = 0; i < chartList.size(); i++) {
    Chart chart = chartList.get(i);
    if (chart.getMarketAverage().equals(BigDecimal.valueOf(-1))) {
        System.out.println("avg: " + chart.getAverage() + "; marketAvg: " + chart.getMarketAverage() + "(at " + chart.getMinute() + ")");
    }
}

java.lang.IllegalStateException

Summary

java.lang.IllegalStateException: Error reading entity from input stream.
When using the KeyStatsRequestBuilder, a lot of the responses seem to trigger the abovementioned exception. I figure it's roughly 50% of the responses that trigger this.

Details

Date/time of issue

Only started using this library today, but was present from first try.

What you expected to happen

Same response format on every request.

What actually happened

Different response format on some requests, hence the exception.

Other Information (sample code, links, etc.)

private static KeyStats KeyStats(String ticker) {
    return iexTradingClient.executeRequest(new KeyStatsRequestBuilder()
            .withSymbol(ticker)
            .build());
}
private static List<ExchangeSymbol> AllTickers() {
    return iexTradingClient.executeRequest(new SymbolsRequestBuilder()
                .build());
}
public static void Start() {
    List<ExchangeSymbol> tickers = AllTickers();
            for (ExchangeSymbol ticker : tickers) {
                try {
                    KeyStats keyStats = KeyStats(ticker.getSymbol());
                } catch (Exception e) {
                    System.out.printf("Exception: %s", e.toString());
                }
            }
}

This produces a lot of the abovementioned exception (sorry if this issue was wrongly raised, I'm very new at programming and only trying to do my best to let you know of this in case it's a legitimate issue).

Fix Quote.extendedPrice

Hi Woj,

New field must have been added. Do you want me to fix this or have you already seen it?

Thanks,
Mike.

Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "extendedPrice" (class pl.zankowski.iextrading4j.api.stocks.Quote), not marked as ignorable (36 known properties: "calculationPrice", "latestVolume", "latestPrice", "week52Low", "primaryExchange", "delayedPrice", "iexRealtimeSize", "iexLastUpdated", "open", "avgTotalVolume", "week52High", "low", "iexVolume", "symbol", "iexAskSize", "high", "closeTime", "sector", "companyName", "iexMarketPercent", "latestUpdate", "latestTime", "changePercent", "marketCap", "openTime", "close", "ytdChange", "previousClose", "latestSource", "iexBidPrice", "iexAskPrice", "peRatio", "iexRealtimePrice", "change", "delayedPriceTime", "iexBidSize"])
at [Source: org.glassfish.jersey.message.internal.EntityInputStream@c372b2; line: 1, column: 865] (through reference chain: pl.zankowski.iextrading4j.api.stocks.Quote["extendedPrice"])

Multiple splits events

In the splits API of IEX there are situations of the same split apearing more than one time, because the company postponed the split

https://cloud.iexapis.com/stable/stock/IRCP/splits/2y

in this case there are only one event postponed 3 times "refid": 2268692

it would solve the problem if the SplitsRequestBuilder() implemented the field "refid":
in the class Split

this way we can manage this situation, in our implementation

in the
https://cloud.iexapis.com/stable/time-series/advanced_splits/IRCP
there are only one event, but this API costs 75.000 credits , it is too much for a large scale implementation of IEX stocks.

can you guys please help?

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.