Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/main/java/com/studerw/tda/model/account/Order.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public class Order implements Serializable {
private TaxLotMethod taxLotMethod;

@JsonProperty("orderLegCollection")
private List<OrderLegCollection> orderLegCollection = new ArrayList<>();
private List<OrderLeg> orderLegs = new ArrayList<>();

@JsonProperty("activationPrice")
private BigDecimal activationPrice;
Expand Down Expand Up @@ -308,13 +308,13 @@ public void setTaxLotMethod(TaxLotMethod taxLotMethod) {
this.taxLotMethod = taxLotMethod;
}

public List<OrderLegCollection> getOrderLegCollection() {
return orderLegCollection;
public List<OrderLeg> getOrderLegs() {
return orderLegs;
}

public void setOrderLegCollection(
List<OrderLegCollection> orderLegCollection) {
this.orderLegCollection = orderLegCollection;
public void setOrderLegs(
List<OrderLeg> orderLegs) {
this.orderLegs = orderLegs;
}

public BigDecimal getActivationPrice() {
Expand Down Expand Up @@ -466,7 +466,7 @@ public String toString() {
.append("priceLinkType", priceLinkType)
.append("price", price)
.append("taxLotMethod", taxLotMethod)
.append("orderLegCollection", orderLegCollection)
.append("orderLegs", orderLegs)
.append("activationPrice", activationPrice)
.append("specialInstruction", specialInstruction)
.append("orderStrategyType", orderStrategyType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import org.apache.commons.lang3.builder.ToStringStyle;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class OrderLegCollection implements Serializable {
public class OrderLeg implements Serializable {

private final static long serialVersionUID = -6019542088004898750L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public class OrderStrategy implements Serializable {
private TaxLotMethod taxLotMethod;

@JsonProperty("orderLegCollection")
private List<OrderLegCollection> orderLegCollection = new ArrayList<>();
private List<OrderLeg> orderLegs = new ArrayList<>();

@JsonProperty("activationPrice")
private BigDecimal activationPrice;
Expand Down Expand Up @@ -213,8 +213,8 @@ public TaxLotMethod getTaxLotMethod() {
return taxLotMethod;
}

public List<OrderLegCollection> getOrderLegCollection() {
return orderLegCollection;
public List<OrderLeg> getOrderLegCollection() {
return orderLegs;
}

public BigDecimal getActivationPrice() {
Expand Down Expand Up @@ -305,7 +305,7 @@ public String toString() {
.append("priceLinkType", priceLinkType)
.append("price", price)
.append("taxLotMethod", taxLotMethod)
.append("orderLegCollection", orderLegCollection)
.append("orderLegs", orderLegs)
.append("activationPrice", activationPrice)
.append("specialInstruction", specialInstruction)
.append("orderStrategyType", orderStrategyType)
Expand Down
14 changes: 7 additions & 7 deletions src/test/java/com/studerw/tda/client/FetchOrdersTestIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import com.studerw.tda.model.account.EquityInstrument;
import com.studerw.tda.model.account.Instrument;
import com.studerw.tda.model.account.Order;
import com.studerw.tda.model.account.OrderLegCollection;
import com.studerw.tda.model.account.OrderLegCollection.Instruction;
import com.studerw.tda.model.account.OrderLegCollection.QuantityType;
import com.studerw.tda.model.account.OrderLeg;
import com.studerw.tda.model.account.OrderLeg.Instruction;
import com.studerw.tda.model.account.OrderLeg.QuantityType;
import com.studerw.tda.model.account.OrderRequest;
import com.studerw.tda.model.account.OrderStrategyType;
import com.studerw.tda.model.account.OrderType;
Expand Down Expand Up @@ -134,10 +134,10 @@ private Order simpleOrder() {
order.setDuration(Duration.DAY);
order.setOrderStrategyType(OrderStrategyType.SINGLE);

OrderLegCollection olc = new OrderLegCollection();
OrderLeg olc = new OrderLeg();
olc.setInstruction(Instruction.SELL);
olc.setQuantity(new BigDecimal("360.888"));
order.getOrderLegCollection().add(olc);
order.getOrderLegs().add(olc);

Instrument instrument = new EquityInstrument();
instrument.setSymbol("F");
Expand All @@ -154,11 +154,11 @@ private Order simpleOrder2() {
order.setOrderStrategyType(OrderStrategyType.SINGLE);
order.setStopPrice(new BigDecimal("4.7"));

OrderLegCollection olc = new OrderLegCollection();
OrderLeg olc = new OrderLeg();
olc.setInstruction(Instruction.SELL);
olc.setQuantity(new BigDecimal("360.888"));
olc.setQuantityType(QuantityType.SHARES);
order.getOrderLegCollection().add(olc);
order.getOrderLegs().add(olc);

Instrument instrument = new EquityInstrument();
instrument.setSymbol("F");
Expand Down
10 changes: 5 additions & 5 deletions src/test/java/com/studerw/tda/parse/TdaJsonParserTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
import com.studerw.tda.model.account.Order;
import com.studerw.tda.model.account.OrderActivity;
import com.studerw.tda.model.account.OrderActivity.ExecutionType;
import com.studerw.tda.model.account.OrderLegCollection;
import com.studerw.tda.model.account.OrderLegCollection.Instruction;
import com.studerw.tda.model.account.OrderLegCollection.OrderLegType;
import com.studerw.tda.model.account.OrderLeg;
import com.studerw.tda.model.account.OrderLeg.Instruction;
import com.studerw.tda.model.account.OrderLeg.OrderLegType;
import com.studerw.tda.model.account.OrderStrategyType;
import com.studerw.tda.model.account.Position;
import com.studerw.tda.model.account.SecuritiesAccount;
Expand Down Expand Up @@ -270,7 +270,7 @@ public void testParseOrders() throws IOException {
assertThat(order.getEditable()).isFalse();
assertThat(order.getQuantity()).isEqualTo("15.0");

OrderLegCollection olc = order.getOrderLegCollection().get(0);
OrderLeg olc = order.getOrderLegs().get(0);
assertThat(olc.getOrderLegType()).isEqualTo(OrderLegType.EQUITY);
assertThat(olc.getInstruction()).isEqualTo(Instruction.BUY);
assertThat(olc.getQuantity()).isEqualTo("15.0");
Expand All @@ -296,7 +296,7 @@ public void testParseOrders2() throws IOException {
assertThat(order.getQuantity()).isEqualTo("360.0");


OrderLegCollection olc = order.getOrderLegCollection().get(0);
OrderLeg olc = order.getOrderLegs().get(0);
assertThat(olc.getOrderLegType()).isEqualTo(OrderLegType.EQUITY);
assertThat(olc.getInstruction()).isEqualTo(Instruction.SELL);
assertThat(olc.getQuantity()).isEqualTo("360.0");
Expand Down