protected void checkExitOrderCompleted(Series <DateTime, MarketDataElement> series) { if (!execution.isPositionOnSignalOnClose()) { return; } immediatePnLAfterPositionClose = 0; int index = execution.getIndexClosedAppOrder(); log.Info("[Strategy] : Exit Strategy Executed!!!"); if (index == 1) { log.Info("Executed Rule = " + execution.PendingOrder1.TriggerRule); log.Info("Executed Rule Remark = " + execution.PendingOrder1.Remark); } else { log.Info("Executed Rule = " + execution.PendingOrder2.TriggerRule); log.Info("Executed Rule Remark = " + execution.PendingOrder2.Remark); } log.Info("******************************************************************"); lastExecutePrice = execution.getFilledPrice(); lastSignalPrice = execution.getSignalPriceForExecution(); execution.completePendingSignal(); stgHelper.cancelPendingTrades(); execution.flushCompletSignal(); if (execution.CurrentMarketPosition == 0) { immediatePnLAfterPositionClose = execution.PnL; execution.PnL = 0; } immediateOrderExit = true; }
private void checkExitOrderCompleted(Series <DateTime, MarketDataElement> series) { if (!execution.isPositionOnSignalOnClose()) { return; } int index = execution.getIndexClosedAppOrder(); log.Info("[Strategy] : Exit Strategy Executed!!!"); if (index == 1) { log.Info("Take Profit Executed!!!"); } else { log.Info("Cutloss Executed!!!"); } log.Info("******************************************************************"); lastExecutePrice = execution.getFilledPrice(); lastSignalPrice = execution.getSignalPriceForExecution(); execution.completePendingSignal(); stgHelper.cancelPendingTrades(); execution.flushCompletSignal(); }