Package com.strategyquant.tradinglib
Class Order
java.lang.Object
com.strategyquant.tradinglib.Order
- All Implemented Interfaces:
Serializable
The Class Order.
- See Also:
- Serialized Form
-
Field Summary
Modifier and TypeFieldDescriptionfloat
The Account balance.float
The Account balance temp.float
ATR(14) on open of the tradeshort
The Bars in trade.float
The Close price.long
The Close time.byte
The Close type.The Comment.float
The Comm swap.boolean
The Comm swap applied.float
The dd.int
The Duration.byte
index of exit (if applicable)float
The Extra 1.byte
The Is in portfolio.float
The mae.int
The Magic number.float
The mfe.static int
The Constant PL_NOT_DEFINED.float
The Open price.long
The Open time.int
The Order.long
The Original open time.float
The Original price.byte
The Original type.float
The Pct account balance.float
The Pct DD.float
The Pct PL.float
The Pct P L TWR.float
The Pips account balance.float
The Pips DD.float
The Pips MAE.float
The Pips MFE.float
The Pips PL.float
The pl.byte
The Sample type.The Setup name.float
The Size.float
The Slippage in money.float
The Stop loss.The Strategy name.The Symbol.float
The Take profit.int
The Ticket.byte
The Type.float
The worst daily equity. -
Constructor Summary
ConstructorDescriptionOrder()
Instantiates a new order.Order(ILiveOrder liveOrder)
Instantiates a new order.Instantiates a new order. -
Method Summary
Modifier and TypeMethodDescriptionfloat
getDDByType(byte plType)
Gets the dd.int
Gets the direction.float
getPLByType(byte plType)
Gets the pl.long
getTimeByPeriodType(byte tradePeriod)
Gets the time.boolean
Checks if is balance order.boolean
Checks if is cancelled order.boolean
Checks if is filled order.boolean
isLong()
Checks if is long.boolean
Checks if is pending order.boolean
Checks if is real order.boolean
isShort()
Checks if is short.void
setFromLiveOrder(ILiveOrder liveOrder)
Sets the from live order.void
setFromOrder(Order o)
Sets the from order.toString()
To string.
-
Field Details
-
NOT_DEFINED
public static final int NOT_DEFINEDThe Constant PL_NOT_DEFINED.- See Also:
- Constant Field Values
-
Symbol
The Symbol. -
SetupName
The Setup name. -
StrategyName
The Strategy name. -
Comment
The Comment. -
Ticket
public int TicketThe Ticket. -
Order
public int OrderThe Order. -
Type
public byte TypeThe Type. -
CloseType
public byte CloseTypeThe Close type. -
SampleType
public byte SampleTypeThe Sample type. -
OriginalOpenTime
public long OriginalOpenTimeThe Original open time. -
OriginalType
public byte OriginalTypeThe Original type. -
MagicNumber
public int MagicNumberThe Magic number. -
Size
public float SizeThe Size. -
OriginalPrice
public float OriginalPriceThe Original price. -
OpenTime
public long OpenTimeThe Open time. -
OpenPrice
public float OpenPriceThe Open price. -
CloseTime
public long CloseTimeThe Close time. -
ClosePrice
public float ClosePriceThe Close price. -
StopLoss
public float StopLossThe Stop loss. -
TakeProfit
public float TakeProfitThe Take profit. -
Duration
public int DurationThe Duration. -
BarsInTrade
public short BarsInTradeThe Bars in trade. -
PL
public float PLThe pl. -
PctPL
public float PctPLThe Pct PL. -
PctPL_TWR
public float PctPL_TWRThe Pct P L TWR. -
PipsPL
public float PipsPLThe Pips PL. -
DD
public float DDThe dd. -
PctDD
public float PctDDThe Pct DD. -
PipsDD
public float PipsDDThe Pips DD. -
CommSwap
public float CommSwapThe Comm swap. -
CommSwapApplied
public boolean CommSwapAppliedThe Comm swap applied. -
MAE
public float MAEThe mae. -
PipsMAE
public float PipsMAEThe Pips MAE. -
MFE
public float MFEThe mfe. -
PipsMFE
public float PipsMFEThe Pips MFE. -
AccountBalance
public float AccountBalanceThe Account balance. -
PctAccountBalance
public float PctAccountBalanceThe Pct account balance. -
PipsAccountBalance
public float PipsAccountBalanceThe Pips account balance. -
AccountBalanceTemp
public float AccountBalanceTempThe Account balance temp. -
Extra1
public float Extra1The Extra 1. -
IsInPortfolio
public byte IsInPortfolioThe Is in portfolio. -
worstDailyEquity
public float worstDailyEquityThe worst daily equity. -
SlippageInMoney
public float SlippageInMoneyThe Slippage in money. -
ExitIndex
public byte ExitIndexindex of exit (if applicable) -
ATROnOpen
public float ATROnOpenATR(14) on open of the trade
-
-
Constructor Details
-
Order
public Order()Instantiates a new order. -
Order
Instantiates a new order.- Parameters:
liveOrder
- the live order
-
Order
Instantiates a new order.- Parameters:
o
- the o
-
-
Method Details
-
setFromLiveOrder
Sets the from live order.- Parameters:
liveOrder
- the new from live order
-
isBalanceOrder
public boolean isBalanceOrder()Checks if is balance order.- Returns:
- true, if is balance order
-
isCanceledOrder
public boolean isCanceledOrder()Checks if is cancelled order.- Returns:
- true, if is cancelled order
-
isPendingOrder
public boolean isPendingOrder()Checks if is pending order.- Returns:
- true, if is pending order
-
getPLByType
public float getPLByType(byte plType)Gets the pl.- Parameters:
plType
- the pl type- Returns:
- the pl
-
getDDByType
public float getDDByType(byte plType)Gets the dd.- Parameters:
plType
- the pl type- Returns:
- the dd
-
getTimeByPeriodType
public long getTimeByPeriodType(byte tradePeriod)Gets the time.- Parameters:
tradePeriod
- the trade period- Returns:
- the time
-
isLong
public boolean isLong()Checks if is long.- Returns:
- true, if is long
-
isShort
public boolean isShort()Checks if is short.- Returns:
- true, if is short
-
toString
To string. -
isRealOrder
public boolean isRealOrder()Checks if is real order.- Returns:
- true, if is real order
-
isFilledOrder
public boolean isFilledOrder()Checks if is filled order.- Returns:
- true, if is filled order
-
setFromOrder
Sets the from order.- Parameters:
o
- the new from order
-
getDirection
public int getDirection()Gets the direction.- Returns:
- the direction
-