Package com.quantcomponents.algo

Examples of com.quantcomponents.algo.ITradeStatsPoint


   
    TableViewerColumn viewColDateTime = new TableViewerColumn(tradesTableViewer, SWT.NONE);
    viewColDateTime.setLabelProvider(new ColumnLabelProvider() {
      @Override
      public String getText(Object element) {
        ITradeStatsPoint t = (ITradeStatsPoint) element;
        return sdf.format(t.getIndex());
      }
    });
    TableColumn columnDateTime = viewColDateTime.getColumn();
    columnDateTime.setText("Time");
    columnDateTime.setWidth(140);
    columnDateTime.setResizable(true);
   
    TableViewerColumn viewColSide = new TableViewerColumn(tradesTableViewer, SWT.NONE);
    viewColSide.setLabelProvider(new ColumnLabelProvider() {
      @Override
      public String getText(Object element) {
        ITradeStatsPoint t = (ITradeStatsPoint) element;
        return t.getTrade().getOrder() != null ? t.getTrade().getOrder().getSide().name() : "";
      }
    });
    TableColumn columnSide = viewColSide.getColumn();
    columnSide.setText("Side");
    columnSide.setWidth(40);
    columnSide.setResizable(true);
   
    TableViewerColumn viewColSize = new TableViewerColumn(tradesTableViewer, SWT.NONE);
    viewColSize.setLabelProvider(new ColumnLabelProvider() {
      @Override
      public String getText(Object element) {
        ITradeStatsPoint t = (ITradeStatsPoint) element;
        return t.getTrade().getOrder() != null ? Integer.toString(t.getTrade().getOrder().getAmount()) : "";
      }
    });
    TableColumn columnSize = viewColSize.getColumn();
    columnSize.setText("Size");
    columnSize.setWidth(40);
    columnSize.setResizable(true);
   
    TableViewerColumn viewColExPrice = new TableViewerColumn(tradesTableViewer, SWT.RIGHT);
    viewColExPrice.setLabelProvider(new ColumnLabelProvider() {
      @Override
      public String getText(Object element) {
        ITradeStatsPoint t = (ITradeStatsPoint) element;
        return df.format(t.getTrade().getExecutionPrice());
      }
    });
    TableColumn columnExPrice = viewColExPrice.getColumn();
    columnExPrice.setText("Ex.Price");
    columnExPrice.setWidth(80);
    columnExPrice.setResizable(true);
   
    TableViewerColumn viewColAvgPrice = new TableViewerColumn(tradesTableViewer, SWT.RIGHT);
    viewColAvgPrice.setLabelProvider(new ColumnLabelProvider() {
      @Override
      public String getText(Object element) {
        ITradeStatsPoint t = (ITradeStatsPoint) element;
        return df.format(t.getTrade().getAveragePrice());
      }
    });
    TableColumn columnAvgPrice = viewColAvgPrice.getColumn();
    columnAvgPrice.setText("Avg.Price");
    columnAvgPrice.setWidth(80);
    columnAvgPrice.setResizable(true);
   
    TableViewerColumn viewColTradePnl = new TableViewerColumn(tradesTableViewer, SWT.RIGHT);
    viewColTradePnl.setLabelProvider(new ColumnLabelProvider() {
      @Override
      public String getText(Object element) {
        ITradeStatsPoint t = (ITradeStatsPoint) element;
        return df.format(t.getTradePnl());
      }
    });
    TableColumn columnTradePnl = viewColTradePnl.getColumn();
    columnTradePnl.setText("Trade P&&L");
    columnTradePnl.setWidth(80);
    columnTradePnl.setResizable(true);
   
    TableViewerColumn viewColMaxFavExc = new TableViewerColumn(tradesTableViewer, SWT.RIGHT);
    viewColMaxFavExc.setLabelProvider(new ColumnLabelProvider() {
      @Override
      public String getText(Object element) {
        ITradeStatsPoint t = (ITradeStatsPoint) element;
        return df.format(t.getMaxFavorableExcursion());
      }
    });
    TableColumn columnMaxFavExc = viewColMaxFavExc.getColumn();
    columnMaxFavExc.setText("Fav.Chg.");
    columnMaxFavExc.setWidth(80);
    columnMaxFavExc.setResizable(true);
   
    TableViewerColumn viewColMaxAdvExc = new TableViewerColumn(tradesTableViewer, SWT.RIGHT);
    viewColMaxAdvExc.setLabelProvider(new ColumnLabelProvider() {
      @Override
      public String getText(Object element) {
        ITradeStatsPoint t = (ITradeStatsPoint) element;
        return df.format(t.getMaxAdverseExcursion());
      }
    });
    TableColumn columnMaxAdvExc = viewColMaxAdvExc.getColumn();
    columnMaxAdvExc.setText("Adv.Chg.");
    columnMaxAdvExc.setWidth(80);
View Full Code Here


    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();
View Full Code Here

TOP

Related Classes of com.quantcomponents.algo.ITradeStatsPoint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.