Skip to content

Commit

Permalink
BybitComplexPositionChanges constructor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rizer1980 committed Oct 9, 2024
1 parent 7e3b3f2 commit d82616f
Showing 1 changed file with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
@Setter
@ToString
public class BybitComplexPositionChanges extends OpenPosition {

private int positionIdx;
private int tradeMode;
private int riskId;
Expand Down Expand Up @@ -63,21 +64,40 @@ public BybitComplexPositionChanges(Instrument instrument, Type type, BigDecimal
public BybitComplexPositionChanges(BybitComplexPositionChanges changes) {
super(changes.getInstrument(), changes.getType(), changes.getSize(), changes.getPrice(),
changes.getLiquidationPrice(), changes.getUnRealisedPnl());
this.positionIdx = changes.positionIdx;
this.tradeMode = changes.tradeMode;
this.riskId = changes.riskId;
this.riskLimitValue = changes.riskLimitValue;
this.markPrice = changes.markPrice;
this.positionBalance = changes.positionBalance;
this.autoAddMargin = changes.autoAddMargin;
this.positionMM = changes.positionMM;
this.positionIM = changes.positionIM;
this.bustPrice = changes.bustPrice;
this.positionValue = changes.positionValue;
this.leverage = changes.leverage;
this.takeProfit = changes.takeProfit;
this.stopLoss = changes.stopLoss;
this.trailingStop = changes.trailingStop;
this.curRealisedPnl = changes.curRealisedPnl;
this.sessionAvgPrice = changes.sessionAvgPrice;
this.positionStatus = changes.positionStatus;
this.adlRankIndicator = changes.adlRankIndicator;
this.isReduceOnly = changes.isReduceOnly;
this.mmrSysUpdatedTime = changes.mmrSysUpdatedTime;
this.leverageSysUpdatedTime = changes.leverageSysUpdatedTime;
this.createdTime = changes.createdTime;
this.updatedTime = changes.updatedTime;
this.seq = changes.seq;
}

public BybitComplexPositionChanges(Instrument instrument, Type type, BigDecimal size,
BigDecimal price, BigDecimal liquidationPrice, BigDecimal unRealisedPnl, int positionIdx,
int tradeMode, int riskId, String riskLimitValue, BigDecimal markPrice,
BigDecimal positionBalance, int autoAddMargin, BigDecimal positionMM, BigDecimal positionIM,
BigDecimal bustPrice, BigDecimal positionValue, BigDecimal leverage,
BigDecimal takeProfit, BigDecimal stopLoss, BigDecimal trailingStop, BigDecimal curRealisedPnl,
BigDecimal takeProfit, BigDecimal stopLoss, BigDecimal trailingStop,
BigDecimal curRealisedPnl,
BigDecimal sessionAvgPrice, String positionStatus, int adlRankIndicator, boolean isReduceOnly,
String mmrSysUpdatedTime, String leverageSysUpdatedTime, long createdTime, long updatedTime,
long seq) {
Expand Down

0 comments on commit d82616f

Please sign in to comment.