org.marketcetera.strategy.java
Class Strategy

java.lang.Object
  extended by org.marketcetera.strategy.AbstractRunningStrategy
      extended by org.marketcetera.strategy.java.Strategy
All Implemented Interfaces:
RunningStrategy

public class Strategy
extends AbstractRunningStrategy

RunningStrategy implementation for Java strategies to extend.

Since:
1.0.0
Version:
$Id: Strategy.java 16154 2012-07-14 16:34:05Z colin $
Author:
Colin DuPlantis

Constructor Summary
Strategy()
           
 
Method Summary
protected  void debug(String inMessage)
          Emits the given debug message to the strategy log output.
protected  void error(String inMessage)
          Emits the given error message to the strategy log output.
protected  void info(String inMessage)
          Emits the given info message to the strategy log output.
protected  void notifyHigh(String inSubject, String inBody)
          Creates and issues a Notification at high priority.
protected  void notifyLow(String inSubject, String inBody)
          Creates and issues a Notification at low priority.
protected  void notifyMedium(String inSubject, String inBody)
          Creates and issues a Notification at medium priority.
 void onAsk(AskEvent inAsk)
          Indicates an AskEvent has been received.
 void onBid(BidEvent inBid)
          Indicates a BidEvent has been received.
 void onCallback(Object inData)
          Indicates a scheduled callback has been executed.
 void onCancelReject(OrderCancelReject inCancel)
          Indicates an OrderCancelReject has been received.
 void onDividend(DividendEvent inStatistics)
          Indicates a DividendEvent has been received.
 void onExecutionReport(ExecutionReport inExecutionReport)
          Indicates an ExecutionReport has been received.
 void onMarketstat(MarketstatEvent inStatistics)
          Indicates a MarketstatEvent has been received.
 void onOther(Object inEvent)
          Indicates an object has been sent that does not fit any of the other callbacks.
 void onStart()
          Called when a strategy is started.
 void onStop()
          Called when a strategy is about to be stopped.
 void onTrade(TradeEvent inTrade)
          Indicates a TradeEvent has been received.
protected  boolean send(Object inData)
          Sends an order to order subscribers.
protected  void warn(String inMessage)
          Emits the given warn message to the strategy log output.
 
Methods inherited from class org.marketcetera.strategy.AbstractRunningStrategy
cancelAllDataRequests, cancelAllOrders, cancelDataFlow, cancelDataRequest, cancelOrder, cancelReplace, createDataFlow, getAllFuturePositionsAsOf, getAllOptionPositionsAsOf, getAllPositionsAsOf, getBrokers, getExecutionReports, getFuturePositionAsOf, getOpenOrderIDs, getOpenOrders, getOptionPositionAsOf, getOptionPositionsAsOf, getOptionRoots, getOrderStatus, getParameter, getPositionAsOf, getProperty, getReportHistoryOriginDate, getSubmittedOrderIDs, getUnderlying, getURN, getUserData, initializeReportHistoryManager, requestCallbackAfter, requestCallbackAt, requestCallbackEvery, requestCEPData, requestMarketData, requestMarketData, requestProcessedMarketData, requestProcessedMarketData, sendEvent, sendEventToCEP, sendMessage, sendNotification, setProperty, setUserData, suggestTrade, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Strategy

public Strategy()
Method Detail

onAsk

public void onAsk(AskEvent inAsk)
Description copied from interface: RunningStrategy
Indicates an AskEvent has been received.

Parameters:
inAsk - an AskEvent value

onBid

public void onBid(BidEvent inBid)
Description copied from interface: RunningStrategy
Indicates a BidEvent has been received.

Parameters:
inBid - a BidEvent value

onMarketstat

public void onMarketstat(MarketstatEvent inStatistics)
Description copied from interface: RunningStrategy
Indicates a MarketstatEvent has been received.

Parameters:
inStatistics - a MarketstatEvent value

onDividend

public void onDividend(DividendEvent inStatistics)
Description copied from interface: RunningStrategy
Indicates a DividendEvent has been received.

Parameters:
inStatistics - a DividendEvent value

onCallback

public void onCallback(Object inData)
Description copied from interface: RunningStrategy
Indicates a scheduled callback has been executed.

Parameters:
inData - an Object value passed to the request for callback method

onExecutionReport

public void onExecutionReport(ExecutionReport inExecutionReport)
Description copied from interface: RunningStrategy
Indicates an ExecutionReport has been received.

Parameters:
inExecutionReport - an ExecutionReport value

onCancelReject

public void onCancelReject(OrderCancelReject inCancel)
Description copied from interface: RunningStrategy
Indicates an OrderCancelReject has been received.

Parameters:
inCancel - an OrderCancelReject value

onOther

public void onOther(Object inEvent)
Description copied from interface: RunningStrategy
Indicates an object has been sent that does not fit any of the other callbacks.

Parameters:
inEvent - an Object value

onTrade

public void onTrade(TradeEvent inTrade)
Description copied from interface: RunningStrategy
Indicates a TradeEvent has been received.

Parameters:
inTrade - a TradeEvent value

onStart

public void onStart()
Description copied from interface: RunningStrategy
Called when a strategy is started.


onStop

public void onStop()
Description copied from interface: RunningStrategy
Called when a strategy is about to be stopped.


notifyLow

protected final void notifyLow(String inSubject,
                               String inBody)
Creates and issues a Notification at low priority.

Parameters:
inSubject - a String value
inBody - a String value

notifyMedium

protected final void notifyMedium(String inSubject,
                                  String inBody)
Creates and issues a Notification at medium priority.

Parameters:
inSubject - a String value
inBody - a String value

notifyHigh

protected final void notifyHigh(String inSubject,
                                String inBody)
Creates and issues a Notification at high priority.

Parameters:
inSubject - a String value
inBody - a String value

debug

protected final void debug(String inMessage)
Emits the given debug message to the strategy log output.

Overrides:
debug in class AbstractRunningStrategy
Parameters:
inMessage - a String value

info

protected final void info(String inMessage)
Emits the given info message to the strategy log output.

Overrides:
info in class AbstractRunningStrategy
Parameters:
inMessage - a String value

warn

protected final void warn(String inMessage)
Emits the given warn message to the strategy log output.

Overrides:
warn in class AbstractRunningStrategy
Parameters:
inMessage - a String value

error

protected final void error(String inMessage)
Emits the given error message to the strategy log output.

Overrides:
error in class AbstractRunningStrategy
Parameters:
inMessage - a String value

send

protected final boolean send(Object inData)
Sends an order to order subscribers.

Overrides:
send in class AbstractRunningStrategy
Parameters:
inData - an Object value
Returns:
a boolean value indicating whether the object was successfully transmitted or not


Copyright © 2012. All Rights Reserved.