org.marketcetera.strategy.java.Strategy Maven / Gradle / Ivy
package org.marketcetera.strategy.java;
import org.marketcetera.client.brokers.BrokerStatus;
import org.marketcetera.core.ClassVersion;
import org.marketcetera.core.notifications.Notification;
import org.marketcetera.event.AskEvent;
import org.marketcetera.event.BidEvent;
import org.marketcetera.event.DividendEvent;
import org.marketcetera.event.MarketstatEvent;
import org.marketcetera.event.TradeEvent;
import org.marketcetera.strategy.AbstractRunningStrategy;
import org.marketcetera.strategy.RunningStrategy;
import org.marketcetera.trade.ExecutionReport;
import org.marketcetera.trade.OrderCancelReject;
/* $License$ */
/**
* {@link RunningStrategy} implementation for Java strategies to extend.
*
* @author Colin DuPlantis
* @version $Id: Strategy.java 16600 2013-06-26 00:53:16Z colin $
* @since 1.0.0
*/
@ClassVersion("$Id: Strategy.java 16600 2013-06-26 00:53:16Z colin $")
public class Strategy
extends AbstractRunningStrategy
{
/*
* (non-Javadoc)
*
* @see org.marketcetera.strategy.RunningStrategy#onAsk(org.marketcetera.event.AskEvent)
*/
@Override
public void onAsk(AskEvent inAsk)
{
}
/*
* (non-Javadoc)
*
* @see org.marketcetera.strategy.RunningStrategy#onBid(org.marketcetera.event.BidEvent)
*/
@Override
public void onBid(BidEvent inBid)
{
}
/* (non-Javadoc)
* @see org.marketcetera.strategy.RunningStrategy#onMarketstat(org.marketcetera.event.MarketstatEvent)
*/
@Override
public void onMarketstat(MarketstatEvent inStatistics)
{
}
/* (non-Javadoc)
* @see org.marketcetera.strategy.RunningStrategy#onDividend(org.marketcetera.event.DividendEvent)
*/
@Override
public void onDividend(DividendEvent inStatistics)
{
}
/*
* (non-Javadoc)
*
* @see org.marketcetera.strategy.RunningStrategy#onCallback(java.lang.Object)
*/
@Override
public void onCallback(Object inData)
{
}
/*
* (non-Javadoc)
*
* @see org.marketcetera.strategy.RunningStrategy#onExecutionReport(org.marketcetera.event.ExecutionReport)
*/
@Override
public void onExecutionReport(ExecutionReport inExecutionReport)
{
}
/* (non-Javadoc)
* @see org.marketcetera.strategy.RunningStrategy#onCancel(org.marketcetera.trade.OrderCancelReject)
*/
@Override
public void onCancelReject(OrderCancelReject inCancel)
{
}
/* (non-Javadoc)
* @see org.marketcetera.strategy.RunningStrategy#onreceiveBrokerStatus(org.marketcetera.brokers.BrokerStatus)
*/
@Override
public void onReceiveBrokerStatus(BrokerStatus inStatus)
{
}
/*
* (non-Javadoc)
*
* @see org.marketcetera.strategy.RunningStrategy#onOther(java.lang.Object)
*/
@Override
public void onOther(Object inEvent)
{
}
/*
* (non-Javadoc)
*
* @see org.marketcetera.strategy.RunningStrategy#onTrade(org.marketcetera.event.TradeEvent)
*/
@Override
public void onTrade(TradeEvent inTrade)
{
}
/* (non-Javadoc)
* @see org.marketcetera.strategy.RunningStrategy#onStart()
*/
@Override
public void onStart()
{
}
/* (non-Javadoc)
* @see org.marketcetera.strategy.RunningStrategy#onStop()
*/
@Override
public void onStop()
{
}
// services start here
/**
* Creates and issues a {@link Notification} at low priority.
*
* @param inSubject a String
value
* @param inBody a String
value
*/
protected final void notifyLow(String inSubject,
String inBody)
{
sendNotification(Notification.low(inSubject,
inBody,
this.toString()));
}
/**
* Creates and issues a {@link Notification} at medium priority.
*
* @param inSubject a String
value
* @param inBody a String
value
*/
protected final void notifyMedium(String inSubject,
String inBody)
{
sendNotification(Notification.medium(inSubject,
inBody,
this.toString()));
}
/**
* Creates and issues a {@link Notification} at high priority.
*
* @param inSubject a String
value
* @param inBody a String
value
*/
protected final void notifyHigh(String inSubject,
String inBody)
{
sendNotification(Notification.high(inSubject,
inBody,
this.toString()));
}
/**
* Emits the given debug message to the strategy log output.
*
* @param inMessage a String
value
*/
@Override
protected final void debug(String inMessage)
{
super.debug(inMessage);
}
/**
* Emits the given info message to the strategy log output.
*
* @param inMessage a String
value
*/
@Override
protected final void info(String inMessage)
{
super.info(inMessage);
}
/**
* Emits the given warn message to the strategy log output.
*
* @param inMessage a String
value
*/
@Override
protected final void warn(String inMessage)
{
super.warn(inMessage);
}
/**
* Emits the given error message to the strategy log output.
*
* @param inMessage a String
value
*/
@Override
protected final void error(String inMessage)
{
super.error(inMessage);
}
/**
* Sends an order to order subscribers.
*
* @param inData an Object
value
* @return a boolean
value indicating whether the object was successfully transmitted or not
*/
@Override
protected final boolean send(Object inData)
{
return super.send(inData);
}
}