executionInfo.processor.unwire();
}
}
private void updateStats() {
final TradeStatsProcessor tradeStatsProcessor = currentExecutionInfo == null ? null : currentExecutionInfo.processor;
if (tradeStatsProcessor != null) {
parent.getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
ITradeStatsPoint bestTrade = tradeStatsProcessor.getBestTrade();
if (bestTrade != null) {
bestTradeTimeDisplay.setText(sdf.format(bestTrade.getIndex()));
bestTradePnlDisplay.setText(df.format(bestTrade.getTradePnl()));
} else {
bestTradeTimeDisplay.setText("");
bestTradePnlDisplay.setText("");
}
ITradeStatsPoint worstTrade = tradeStatsProcessor.getWorstTrade();
if (worstTrade != null) {
worstTradeTimeDisplay.setText(sdf.format(worstTrade.getIndex()));
worstTradePnlDisplay.setText(df.format(worstTrade.getTradePnl()));
} else {
worstTradeTimeDisplay.setText("");
worstTradePnlDisplay.setText("");
}
SimplePoint maxDDEnd = tradeStatsProcessor.getEndOfMaxDrawdown();
if (maxDDEnd != null) {
maxDrawdownEndTimeDisplay.setText(sdf.format(maxDDEnd.getIndex()));
maxDrawdownValueDisplay.setText(df.format(maxDDEnd.getValue() - tradeStatsProcessor.getStartOfMaxDrawdown().getValue()));
} else {
maxDrawdownEndTimeDisplay.setText("");
maxDrawdownValueDisplay.setText("");
}
SimplePoint maxRUEnd = tradeStatsProcessor.getEndOfMaxRunup();
if (maxRUEnd != null) {
maxRunupEndTimeDisplay.setText(sdf.format(maxRUEnd.getIndex()));
maxRunupValueDisplay.setText(df.format(maxRUEnd.getValue() - tradeStatsProcessor.getStartOfMaxRunup().getValue()));
} else {
maxRunupEndTimeDisplay.setText("");
maxRunupValueDisplay.setText("");
}
SimplePoint lowestEP = tradeStatsProcessor.getLowestEquityPoint();
if (lowestEP != null) {
lowestEquityTimeDisplay.setText(sdf.format(lowestEP.getIndex()));
lowestEquityValueDisplay.setText(df.format(lowestEP.getValue()));
} else {
lowestEquityTimeDisplay.setText("");
lowestEquityValueDisplay.setText("");
}
SimplePoint highestEP = tradeStatsProcessor.getHighestEquityPoint();
if (highestEP != null) {
highestEquityTimeDisplay.setText(sdf.format(highestEP.getIndex()));
highestEquityValueDisplay.setText(df.format(highestEP.getValue()));
} else {
highestEquityTimeDisplay.setText("");