Example #1
0
 @Override
 public void tickEFP(
     final int tickerId,
     final int tickType,
     final double basisPoints,
     final String formattedBasisPoints,
     final double impliedFuture,
     final int holdDays,
     final String futureExpiry,
     final double dividendImpact,
     final double dividendsToExpiry) {
   final TickEFP o =
       new TickEFP(
           tickerId,
           tickType,
           basisPoints,
           formattedBasisPoints,
           impliedFuture,
           holdDays,
           futureExpiry,
           dividendImpact,
           dividendsToExpiry);
   ServiceLocator.commonInstance().getRuleService().sendEvent(StrategyImpl.BASE, o);
   logger.trace(
       EWrapperMsgGenerator.tickEFP(
           tickerId,
           tickType,
           basisPoints,
           formattedBasisPoints,
           impliedFuture,
           holdDays,
           futureExpiry,
           dividendImpact,
           dividendsToExpiry));
 }
Example #2
0
 @Override
 public void tickOptionComputation(
     final int tickerId,
     final int field,
     final double impliedVol,
     final double delta,
     final double optPrice,
     final double pvDividend,
     final double gamma,
     final double vega,
     final double theta,
     final double undPrice) {
   final TickOptionComputation o =
       new TickOptionComputation(
           tickerId, field, impliedVol, delta, optPrice, pvDividend, gamma, vega, theta, undPrice);
   ServiceLocator.commonInstance().getRuleService().sendEvent(StrategyImpl.BASE, o);
   logger.trace(
       EWrapperMsgGenerator.tickOptionComputation(
           tickerId,
           field,
           impliedVol,
           delta,
           optPrice,
           pvDividend,
           gamma,
           vega,
           theta,
           undPrice));
 }
Example #3
0
 @Override
 public void tickPrice(
     final int tickerId, final int field, final double price, final int canAutoExecute) {
   final TickPrice o = new TickPrice(tickerId, field, price, canAutoExecute);
   ServiceLocator.commonInstance().getRuleService().sendEvent(StrategyImpl.BASE, o);
   logger.trace(EWrapperMsgGenerator.tickPrice(tickerId, field, price, canAutoExecute));
 }
Example #4
0
 @Override
 public void openOrder(
     final int orderId, final Contract contract, final Order order, final OrderState orderState) {
   final OpenOrder o = new OpenOrder(orderId, contract, order, orderState);
   ServiceLocator.commonInstance().getRuleService().sendEvent(StrategyImpl.BASE, o);
   logger.debug(EWrapperMsgGenerator.openOrder(orderId, contract, order, orderState));
 }
Example #5
0
 @Override
 public void updateNewsBulletin(
     final int msgId, final int msgType, final String message, final String origExchange) {
   final UpdateNewsBulletin o = new UpdateNewsBulletin(msgId, msgType, message, origExchange);
   ServiceLocator.commonInstance().getRuleService().sendEvent(StrategyImpl.BASE, o);
   logger.debug(EWrapperMsgGenerator.updateNewsBulletin(msgId, msgType, message, origExchange));
 }
Example #6
0
 @Override
 public void updateAccountValue(
     final String key, final String value, final String currency, final String accountName) {
   final UpdateAccountValue o = new UpdateAccountValue(key, value, currency, accountName);
   ServiceLocator.commonInstance().getRuleService().sendEvent(StrategyImpl.BASE, o);
   logger.debug(EWrapperMsgGenerator.updateAccountValue(key, value, currency, accountName));
 }
Example #7
0
 @Override
 public void updatePortfolio(
     final Contract contract,
     final int position,
     final double marketPrice,
     final double marketValue,
     final double averageCost,
     final double unrealizedPNL,
     final double realizedPNL,
     final String accountName) {
   final UpdatePortfolio o =
       new UpdatePortfolio(
           contract,
           position,
           marketPrice,
           marketValue,
           averageCost,
           unrealizedPNL,
           realizedPNL,
           accountName);
   ServiceLocator.commonInstance().getRuleService().sendEvent(StrategyImpl.BASE, o);
   logger.debug(
       EWrapperMsgGenerator.updatePortfolio(
           contract,
           position,
           marketPrice,
           marketValue,
           averageCost,
           unrealizedPNL,
           realizedPNL,
           accountName));
 }
Example #8
0
 @Override
 public void updateMktDepth(
     final int tickerId,
     final int position,
     final int operation,
     final int side,
     final double price,
     final int size) {
   final UpdateMktDepth o = new UpdateMktDepth(tickerId, position, operation, side, price, size);
   ServiceLocator.commonInstance().getRuleService().sendEvent(StrategyImpl.BASE, o);
   logger.debug(
       EWrapperMsgGenerator.updateMktDepth(tickerId, position, operation, side, price, size));
 }
Example #9
0
 @Override
 public void realtimeBar(
     final int reqId,
     final long time,
     final double open,
     final double high,
     final double low,
     final double close,
     final long volume,
     final double wap,
     final int count) {
   final RealtimeBar o = new RealtimeBar(reqId, time, open, high, low, close, volume, wap, count);
   ServiceLocator.commonInstance().getRuleService().sendEvent(StrategyImpl.BASE, o);
   logger.debug(
       EWrapperMsgGenerator.realtimeBar(reqId, time, open, high, low, close, volume, wap, count));
 }
Example #10
0
 @Override
 public void scannerData(
     final int reqId,
     final int rank,
     final ContractDetails contractDetails,
     final String distance,
     final String benchmark,
     final String projection,
     final String legsStr) {
   final ScannerData o =
       new ScannerData(reqId, rank, contractDetails, distance, benchmark, projection, legsStr);
   ServiceLocator.commonInstance().getRuleService().sendEvent(StrategyImpl.BASE, o);
   logger.debug(
       EWrapperMsgGenerator.scannerData(
           reqId, rank, contractDetails, distance, benchmark, projection, legsStr));
 }
Example #11
0
 @Override
 public void historicalData(
     final int reqId,
     final String date,
     final double open,
     final double high,
     final double low,
     final double close,
     final int volume,
     final int count,
     final double wap,
     final boolean hasGaps) {
   final HistoricalData o =
       new HistoricalData(reqId, date, open, high, low, close, volume, count, wap, hasGaps);
   ServiceLocator.commonInstance().getRuleService().sendEvent(StrategyImpl.BASE, o);
   logger.debug(
       EWrapperMsgGenerator.historicalData(
           reqId, date, open, high, low, close, volume, count, wap, hasGaps));
 }
Example #12
0
 @Override
 public void orderStatus(
     final int orderId,
     final String status,
     final int filled,
     final int remaining,
     final double avgFillPrice,
     final int permId,
     final int parentId,
     final double lastFillPrice,
     final int clientId,
     final String whyHeld) {
   final OrderStatus o =
       new OrderStatus(
           orderId,
           status,
           filled,
           remaining,
           avgFillPrice,
           permId,
           parentId,
           lastFillPrice,
           clientId,
           whyHeld);
   ServiceLocator.commonInstance().getRuleService().sendEvent(StrategyImpl.BASE, o);
   logger.debug(
       EWrapperMsgGenerator.orderStatus(
           orderId,
           status,
           filled,
           remaining,
           avgFillPrice,
           permId,
           parentId,
           lastFillPrice,
           clientId,
           whyHeld));
 }
Example #13
0
 @Override
 public void scannerParameters(final String xml) {
   final ScannerParameters o = new ScannerParameters(xml);
   ServiceLocator.commonInstance().getRuleService().sendEvent(StrategyImpl.BASE, o);
   logger.debug(EWrapperMsgGenerator.scannerParameters(xml));
 }
Example #14
0
 @Override
 public void managedAccounts(final String accountsList) {
   final ManagedAccounts o = new ManagedAccounts(accountsList);
   ServiceLocator.commonInstance().getRuleService().sendEvent(StrategyImpl.BASE, o);
   logger.debug(EWrapperMsgGenerator.managedAccounts(accountsList));
 }
Example #15
0
 @Override
 public void updateAccountTime(final String timeStamp) {
   final UpdateAccountTime o = new UpdateAccountTime(timeStamp);
   ServiceLocator.commonInstance().getRuleService().sendEvent(StrategyImpl.BASE, o);
   logger.debug(EWrapperMsgGenerator.updateAccountTime(timeStamp));
 }
Example #16
0
 @Override
 public void tickString(final int tickerId, final int tickType, final String value) {
   final TickString o = new TickString(tickerId, tickType, value);
   ServiceLocator.commonInstance().getRuleService().sendEvent(StrategyImpl.BASE, o);
   logger.trace(EWrapperMsgGenerator.tickString(tickerId, tickType, value));
 }
Example #17
0
 @Override
 public void tickSnapshotEnd(final int reqId) {
   final TickSnapshotEnd o = new TickSnapshotEnd(reqId);
   ServiceLocator.commonInstance().getRuleService().sendEvent(StrategyImpl.BASE, o);
   logger.trace(EWrapperMsgGenerator.tickSnapshotEnd(reqId));
 }
Example #18
0
 @Override
 public void tickSize(final int tickerId, final int field, final int size) {
   final TickSize o = new TickSize(tickerId, field, size);
   ServiceLocator.commonInstance().getRuleService().sendEvent(StrategyImpl.BASE, o);
   logger.trace(EWrapperMsgGenerator.tickSize(tickerId, field, size));
 }
Example #19
0
 @Override
 public void accountDownloadEnd(final String accountName) {
   final AccountDownloadEnd o = new AccountDownloadEnd(accountName);
   ServiceLocator.commonInstance().getRuleService().sendEvent(StrategyImpl.BASE, o);
   logger.debug(EWrapperMsgGenerator.accountDownloadEnd(accountName));
 }
Example #20
0
 @Override
 public void scannerDataEnd(final int reqId) {
   final ScannerDataEnd o = new ScannerDataEnd(reqId);
   ServiceLocator.commonInstance().getRuleService().sendEvent(StrategyImpl.BASE, o);
   logger.debug(EWrapperMsgGenerator.scannerDataEnd(reqId));
 }
Example #21
0
 @Override
 public void receiveFA(final int faDataType, final String xml) {
   final ReceiveFA o = new ReceiveFA(faDataType, xml);
   ServiceLocator.commonInstance().getRuleService().sendEvent(StrategyImpl.BASE, o);
   logger.debug(EWrapperMsgGenerator.receiveFA(faDataType, xml));
 }
Example #22
0
 @Override
 public void contractDetailsEnd(final int reqId) {
   final ContractDetailsEnd o = new ContractDetailsEnd(reqId);
   ServiceLocator.commonInstance().getRuleService().sendEvent(StrategyImpl.BASE, o);
   logger.debug(EWrapperMsgGenerator.contractDetailsEnd(reqId));
 }
Example #23
0
 @Override
 public void execDetails(final int reqId, final Contract contract, final Execution execution) {
   final ExecDetails o = new ExecDetails(reqId, contract, execution);
   ServiceLocator.commonInstance().getRuleService().sendEvent(StrategyImpl.BASE, o);
   logger.debug(EWrapperMsgGenerator.execDetails(reqId, contract, execution));
 }
Example #24
0
 @Override
 public void bondContractDetails(final int reqId, final ContractDetails contractDetails) {
   final ContractDetailsCommon o = new ContractDetailsCommon(reqId, contractDetails);
   ServiceLocator.commonInstance().getRuleService().sendEvent(StrategyImpl.BASE, o);
   logger.debug(EWrapperMsgGenerator.bondContractDetails(reqId, contractDetails));
 }
Example #25
0
 @Override
 public void fundamentalData(final int reqId, final String data) {
   final FundamentalData o = new FundamentalData(reqId, data);
   ServiceLocator.commonInstance().getRuleService().sendEvent(StrategyImpl.BASE, o);
   logger.debug(EWrapperMsgGenerator.fundamentalData(reqId, data));
 }
Example #26
0
 @Override
 public void currentTime(final long time) {
   final CurrentTime o = new CurrentTime(time);
   ServiceLocator.commonInstance().getRuleService().sendEvent(StrategyImpl.BASE, o);
   logger.debug(EWrapperMsgGenerator.currentTime(time));
 }
Example #27
0
 @Override
 public void deltaNeutralValidation(final int reqId, final UnderComp underComp) {
   final DeltaNeutralValidation o = new DeltaNeutralValidation(reqId, underComp);
   ServiceLocator.commonInstance().getRuleService().sendEvent(StrategyImpl.BASE, o);
   logger.debug(EWrapperMsgGenerator.deltaNeutralValidation(reqId, underComp));
 }