Skip to content

Commit

Permalink
Update advanced stats model (#75)
Browse files Browse the repository at this point in the history
* Create daily Sentiment request builder

* Replace CryptoBook and CryptoBookEntry with Book and BookEntry

* Update to 3.3.0 version

* Update to 3.3.0 version
  • Loading branch information
WojciechZankowski authored Oct 26, 2019
1 parent 8883357 commit e8f5fa1
Show file tree
Hide file tree
Showing 24 changed files with 88 additions and 269 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# Change Log
All notable changes to this project will be documented in this file.

## [3.3.0] - 2019-10-26

### Added

- Daily Sentiment request builder

### Changed

- Added week52highDate and week52lowDate to AdvancedStats model
- Replaced CryptoBook and CryptoBookEntry with Book and BookEntry

## [3.2.8] - 2019-10-12

### Added
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,22 @@ Maven:
<dependency>
<groupId>pl.zankowski</groupId>
<artifactId>iextrading4j-all</artifactId>
<version>3.2.8</version>
<version>3.3.0</version>
</dependency>
```

Gradle:

```
dependencies {
compile 'pl.zankowski:iextrading4j-all:3.2.8'
compile 'pl.zankowski:iextrading4j-all:3.3.0'
}
```

Library is up to:

* IEX Trading API version [1.24] - 09.11.2018
* IEX Cloud API version [1.0] - 12.10.2019
* IEX Cloud API version [1.0] - 26.10.2019

Supported versions: Java SE 8, Java SE 9, Java SE 10, Java SE 11, Java SE 12

Expand Down
2 changes: 1 addition & 1 deletion iextrading4j-acceptance/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>iextrading4j</artifactId>
<groupId>pl.zankowski</groupId>
<version>3.2.8</version>
<version>3.3.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import org.junit.Test;
import pl.zankowski.iextrading4j.api.alternative.CeoCompensation;
import pl.zankowski.iextrading4j.api.alternative.CryptoBook;
import pl.zankowski.iextrading4j.api.alternative.CryptoPrice;
import pl.zankowski.iextrading4j.api.alternative.Sentiment;
import pl.zankowski.iextrading4j.api.marketdata.Book;
import pl.zankowski.iextrading4j.api.stocks.Quote;
import pl.zankowski.iextrading4j.client.rest.request.alternative.CeoCompensationRequestBuilder;
import pl.zankowski.iextrading4j.client.rest.request.alternative.CryptoBookRequestBuilder;
Expand Down Expand Up @@ -47,7 +47,7 @@ public void cryptoPriceTest() {

@Test
public void cryptoBookTest() {
final CryptoBook book = cloudClient.executeRequest(new CryptoBookRequestBuilder()
final Book book = cloudClient.executeRequest(new CryptoBookRequestBuilder()
.withSymbol("BTCUSD")
.build());
assertThat(book).isNotNull();
Expand Down
2 changes: 1 addition & 1 deletion iextrading4j-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>iextrading4j</artifactId>
<groupId>pl.zankowski</groupId>
<version>3.2.8</version>
<version>3.3.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion iextrading4j-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>iextrading4j</artifactId>
<groupId>pl.zankowski</groupId>
<version>3.2.8</version>
<version>3.3.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import pl.zankowski.iextrading4j.api.marketdata.BookEntry;

import java.io.Serializable;
import java.util.List;
Expand All @@ -17,13 +18,13 @@ public class CryptoBookEvent implements Serializable {
private static final long serialVersionUID = -2249655496972607126L;

private final String symbol;
private final List<CryptoBookEntry> bid;
private final List<CryptoBookEntry> ask;
private final List<BookEntry> bid;
private final List<BookEntry> ask;

@JsonCreator
public CryptoBookEvent(
@JsonProperty("bids") final List<CryptoBookEntry> bid,
@JsonProperty("asks") final List<CryptoBookEntry> ask,
@JsonProperty("bids") final List<BookEntry> bid,
@JsonProperty("asks") final List<BookEntry> ask,
@JsonProperty("symbol") final String symbol) {
this.symbol = symbol;
this.bid = immutableList(bid);
Expand All @@ -34,11 +35,11 @@ public String getSymbol() {
return symbol;
}

public List<CryptoBookEntry> getBid() {
public List<BookEntry> getBid() {
return bid;
}

public List<CryptoBookEntry> getAsk() {
public List<BookEntry> getAsk() {
return ask;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public class AdvancedStats extends KeyStats {
private final BigDecimal pegRatio;
private final BigDecimal peHigh;
private final BigDecimal peLow;
private final LocalDate week52highDate;
private final LocalDate week52lowDate;

@JsonCreator
public AdvancedStats(
Expand Down Expand Up @@ -81,7 +83,9 @@ public AdvancedStats(
@JsonProperty("pegRatio") final BigDecimal pegRatio,
@JsonProperty("beta") final BigDecimal beta,
@JsonProperty("peHigh") final BigDecimal peHigh,
@JsonProperty("peLow") final BigDecimal peLow) {
@JsonProperty("peLow") final BigDecimal peLow,
@JsonProperty("week52highDate") final LocalDate week52highDate,
@JsonProperty("week52lowDate") final LocalDate week52lowDate) {
super(companyName, marketcap, week52high, week52low, week52change, sharesOutstanding, aFloat, symbol,
avg10Volume, avg30Volume, day200MovingAvg, day50MovingAvg, employees, ttmEPS, ttmDividendRate,
dividendYield, nextDividendDate, exDividendDate, nextEarningsDate, peRatio, maxChangePercent,
Expand All @@ -105,6 +109,8 @@ public AdvancedStats(
this.pegRatio = pegRatio;
this.peHigh = peHigh;
this.peLow = peLow;
this.week52highDate = week52highDate;
this.week52lowDate = week52lowDate;
}

public BigDecimal getTotalCash() {
Expand Down Expand Up @@ -179,6 +185,14 @@ public BigDecimal getPeLow() {
return peLow;
}

public LocalDate getWeek52highDate() {
return week52highDate;
}

public LocalDate getWeek52lowDate() {
return week52lowDate;
}

@Override
public boolean equals(final Object o) {
if (this == o) {
Expand Down Expand Up @@ -208,15 +222,17 @@ public boolean equals(final Object o) {
Objects.equal(forwardPERatio, that.forwardPERatio) &&
Objects.equal(pegRatio, that.pegRatio) &&
Objects.equal(peHigh, that.peHigh) &&
Objects.equal(peLow, that.peLow);
Objects.equal(peLow, that.peLow) &&
Objects.equal(week52highDate, that.week52highDate) &&
Objects.equal(week52lowDate, that.week52lowDate);
}

@Override
public int hashCode() {
return Objects.hashCode(super.hashCode(), totalCash, currentDebt, revenue, grossProfit,
totalRevenue, ebitda, revenuePerShare, revenuePerEmployee, debtToEquity, profitMargin,
enterpriseValue, enterpriseValueToRevenue, priceToSales, priceToBook, forwardPERatio,
pegRatio, peHigh, peLow);
pegRatio, peHigh, peLow, week52highDate, week52lowDate);
}

@Override
Expand All @@ -240,6 +256,8 @@ public String toString() {
.add("pegRatio", pegRatio)
.add("peHigh", peHigh)
.add("peLow", peLow)
.add("week52highDate", week52highDate)
.add("week52lowDate", week52lowDate)
.toString();
}
}

This file was deleted.

Loading

0 comments on commit e8f5fa1

Please sign in to comment.