Class Execution
java.lang.Object
com.motivewave.platform.sdk.order_mgmt.Execution
Represents an executed order.
-
Constructor Summary
ConstructorDescriptionExecution
(OrderContext ctx, Order order, boolean includeCommission) ConstructorExecution
(String acctId, String execId, Instrument instr, Object refId, long time, Enums.OrderAction action, float qty, float avgPrice, float entryPrice, Enums.ExecutionType type, float pnl, float pips, float commission, float position, int barCount, float maxPriceReached, float minPriceReached) Constructor -
Method Summary
Modifier and TypeMethodDescriptionGets the ID of the account that this execution occurred on.Gets the action (buy or sell)float
Gets the average fill price.int
getBar()
Gets the index of the bar when this execution occurred (since the strategy was last activated)double
Gets the commission.float
Gets the entry price.getId()
Gets the unique ID of this execution.Gets the instrument that was traded.float
Gets the maximum price reached since the last execution.float
Gets the minimum price reached since the last execution.double
Gets the net profit/loss (includes commission cost).float
getPips()
Gets the pips (points) gained/lostdouble
getPnl()
Gets the profit or loss associated with this trade.int
Gets the position held after this execution.float
Gets the position held after this execution (as a floating point for partial positions).int
Gets the quantity that was executed.float
Gets the quantity that was executed (as a floating point for partial quantities).Gets the reference ID for this execution.long
getTime()
Gets the time this execution occurred.getType()
Gets the type of execution (Entry, Exit or SAR).toString()
-
Constructor Details
-
Execution
Constructor- Parameters:
ctx
- order contextorder
-includeCommission
-
-
Execution
public Execution(String acctId, String execId, Instrument instr, Object refId, long time, Enums.OrderAction action, float qty, float avgPrice, float entryPrice, Enums.ExecutionType type, float pnl, float pips, float commission, float position, int barCount, float maxPriceReached, float minPriceReached) Constructor- Parameters:
acctId
-execId
-instr
-refId
-time
-action
-qty
-avgPrice
-entryPrice
-type
-pnl
-pips
-commission
-position
-barCount
-maxPriceReached
-minPriceReached
-
-
-
Method Details
-
getAccountId
Gets the ID of the account that this execution occurred on. -
getId
Gets the unique ID of this execution. -
getInstrument
Gets the instrument that was traded. -
getReferenceId
Gets the reference ID for this execution. -
getTime
public long getTime()Gets the time this execution occurred. -
getAction
Gets the action (buy or sell) -
getQuantity
public int getQuantity()Gets the quantity that was executed. -
getQuantityAsFloat
public float getQuantityAsFloat()Gets the quantity that was executed (as a floating point for partial quantities). -
getAvgPrice
public float getAvgPrice()Gets the average fill price. -
getEntryPrice
public float getEntryPrice()Gets the entry price. -
getType
Gets the type of execution (Entry, Exit or SAR). -
getPnl
public double getPnl()Gets the profit or loss associated with this trade. -
getCommission
public double getCommission()Gets the commission. -
getNetPnl
public double getNetPnl()Gets the net profit/loss (includes commission cost). -
getPips
public float getPips()Gets the pips (points) gained/lost -
getPosition
public int getPosition()Gets the position held after this execution. -
getPositionAsFloat
public float getPositionAsFloat()Gets the position held after this execution (as a floating point for partial positions). -
getBar
public int getBar()Gets the index of the bar when this execution occurred (since the strategy was last activated) -
getMaxPriceReached
public float getMaxPriceReached()Gets the maximum price reached since the last execution. -
getMinPriceReached
public float getMinPriceReached()Gets the minimum price reached since the last execution. -
toString
-