Class AbstractExecutionPlatform
- java.lang.Object
-
- de.gsi.financial.samples.service.execution.AbstractExecutionPlatform
-
- All Implemented Interfaces:
ExecutionPlatform
- Direct Known Subclasses:
BacktestExecutionPlatform
public abstract class AbstractExecutionPlatform extends java.lang.Object implements ExecutionPlatform
- Author:
- afischer
-
-
Field Summary
Fields Modifier and Type Field Description protected de.gsi.dataset.spi.financial.api.attrs.AttributeModelcontextprotected OrderContainerordersprotected PositionContainerpositions
-
Constructor Summary
Constructors Constructor Description AbstractExecutionPlatform()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddExecutionPlatformListener(ExecutionPlatformListener listener)Add the listener of execution platformExecutionResultcancelOrder(int orderId)Cancel the trading orderExecutionResultcancelOrder(Order order)Cancel the trading orderprotected abstract ExecutionResultensureRequiredOrderAttributes(Order order)Ensure the required attributes for orderprotected abstract ExecutionResultexecuteOrder(Order order)Execute order by gatewayprotected abstract ExecutionResultexecuteOrderCancellation(Order order)Execute order cancellation by gatewayprotected voidfireOrderCancelled(Order order)protected voidfireOrderFilled(Order order)ExecutionResultperformOrder(Order order)Execute the trading orderprotected ExecutionResultprocessOrder(Order order)Processing of ordervoidremoveExecutionPlatformListener(ExecutionPlatformListener listener)Remove the listener of execution platformvoidsetContext(de.gsi.dataset.spi.financial.api.attrs.AttributeModel context)protected ExecutionResultsetRequiredOrderAttributes(Order order)protected voidstoreOrder(Order order)
-
-
-
Field Detail
-
context
protected de.gsi.dataset.spi.financial.api.attrs.AttributeModel context
-
orders
protected OrderContainer orders
-
positions
protected PositionContainer positions
-
-
Method Detail
-
setContext
public void setContext(de.gsi.dataset.spi.financial.api.attrs.AttributeModel context)
-
addExecutionPlatformListener
public void addExecutionPlatformListener(ExecutionPlatformListener listener)
Description copied from interface:ExecutionPlatformAdd the listener of execution platform- Specified by:
addExecutionPlatformListenerin interfaceExecutionPlatform- Parameters:
listener- ExecutionPlatformListener
-
removeExecutionPlatformListener
public void removeExecutionPlatformListener(ExecutionPlatformListener listener)
Description copied from interface:ExecutionPlatformRemove the listener of execution platform- Specified by:
removeExecutionPlatformListenerin interfaceExecutionPlatform- Parameters:
listener- ExecutionPlatformListener
-
fireOrderFilled
protected void fireOrderFilled(Order order)
-
fireOrderCancelled
protected void fireOrderCancelled(Order order)
-
performOrder
public ExecutionResult performOrder(Order order)
Description copied from interface:ExecutionPlatformExecute the trading order- Specified by:
performOrderin interfaceExecutionPlatform- Parameters:
order- Order- Returns:
- result
-
cancelOrder
public ExecutionResult cancelOrder(int orderId)
Description copied from interface:ExecutionPlatformCancel the trading order- Specified by:
cancelOrderin interfaceExecutionPlatform- Parameters:
orderId- int- Returns:
- result
-
cancelOrder
public ExecutionResult cancelOrder(Order order)
Description copied from interface:ExecutionPlatformCancel the trading order- Specified by:
cancelOrderin interfaceExecutionPlatform- Parameters:
order- instance- Returns:
- result
-
setRequiredOrderAttributes
protected ExecutionResult setRequiredOrderAttributes(Order order)
-
storeOrder
protected void storeOrder(Order order)
-
processOrder
protected ExecutionResult processOrder(Order order)
Processing of order- Parameters:
order- Order- Returns:
- result
-
ensureRequiredOrderAttributes
protected abstract ExecutionResult ensureRequiredOrderAttributes(Order order)
Ensure the required attributes for order- Parameters:
order- Order
-
executeOrder
protected abstract ExecutionResult executeOrder(Order order)
Execute order by gateway- Parameters:
order- Order- Returns:
- result
-
executeOrderCancellation
protected abstract ExecutionResult executeOrderCancellation(Order order)
Execute order cancellation by gateway- Parameters:
order- Order- Returns:
- result
-
-