コード例 #1
0
ファイル: IBEsperAdapter.java プロジェクト: heber/algo-trader
 @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));
 }
コード例 #2
0
ファイル: IBEsperAdapter.java プロジェクト: heber/algo-trader
 @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));
 }
コード例 #3
0
ファイル: IBEsperAdapter.java プロジェクト: heber/algo-trader
 @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));
 }
コード例 #4
0
ファイル: IBEsperAdapter.java プロジェクト: heber/algo-trader
 @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));
 }
コード例 #5
0
ファイル: IBEsperAdapter.java プロジェクト: heber/algo-trader
 @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));
 }
コード例 #6
0
ファイル: IBEsperAdapter.java プロジェクト: heber/algo-trader
 @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));
 }
コード例 #7
0
ファイル: IBEsperAdapter.java プロジェクト: heber/algo-trader
 @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));
 }
コード例 #8
0
ファイル: IBEsperAdapter.java プロジェクト: heber/algo-trader
 @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));
 }
コード例 #9
0
ファイル: IBEsperAdapter.java プロジェクト: heber/algo-trader
 @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));
 }
コード例 #10
0
ファイル: IBEsperAdapter.java プロジェクト: heber/algo-trader
 @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));
 }
コード例 #11
0
ファイル: IBEsperAdapter.java プロジェクト: heber/algo-trader
 @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));
 }
コード例 #12
0
ファイル: IBEsperAdapter.java プロジェクト: heber/algo-trader
 @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));
 }
コード例 #13
0
ファイル: IBEsperAdapter.java プロジェクト: heber/algo-trader
 @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));
 }
コード例 #14
0
ファイル: IBEsperAdapter.java プロジェクト: heber/algo-trader
 @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));
 }
コード例 #15
0
ファイル: IBEsperAdapter.java プロジェクト: heber/algo-trader
 @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));
 }
コード例 #16
0
ファイル: IBEsperAdapter.java プロジェクト: heber/algo-trader
 @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));
 }
コード例 #17
0
ファイル: IBEsperAdapter.java プロジェクト: heber/algo-trader
 @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));
 }
コード例 #18
0
ファイル: IBEsperAdapter.java プロジェクト: heber/algo-trader
 @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));
 }
コード例 #19
0
ファイル: IBEsperAdapter.java プロジェクト: heber/algo-trader
 @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));
 }
コード例 #20
0
ファイル: IBEsperAdapter.java プロジェクト: heber/algo-trader
 @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));
 }
コード例 #21
0
ファイル: IBEsperAdapter.java プロジェクト: heber/algo-trader
 @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));
 }
コード例 #22
0
ファイル: IBEsperAdapter.java プロジェクト: heber/algo-trader
 @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));
 }
コード例 #23
0
ファイル: IBEsperAdapter.java プロジェクト: heber/algo-trader
 @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));
 }
コード例 #24
0
ファイル: IBEsperAdapter.java プロジェクト: heber/algo-trader
 @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));
 }
コード例 #25
0
ファイル: IBEsperAdapter.java プロジェクト: heber/algo-trader
 @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));
 }
コード例 #26
0
ファイル: IBEsperAdapter.java プロジェクト: heber/algo-trader
 @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));
 }
コード例 #27
0
ファイル: IBEsperAdapter.java プロジェクト: heber/algo-trader
 @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));
 }