Package com.quantcomponents.core.series

Examples of com.quantcomponents.core.series.SimplePoint


  }

  private void onPositionUpdate(IContract contract, IPosition position) {
    positions.put(contract, position);
    double pnl = calculatePnl();
    SimplePoint point = new SimplePoint(position.getTimestamp(), pnl);
    if (outputSeries != null) {
      outputSeries.insertFromTail(point);
    }
  }
View Full Code Here


            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("");
            highestEquityValueDisplay.setText("");
          }
          tradesTableViewer.refresh();
View Full Code Here

    }
  }

  private void updatePriceStats(Date timestamp) {
    double pnl = calculateTotalPnl();
    SimplePoint point = new SimplePoint(timestamp, pnl);
    if (lowestEquityPoint == null || pnl < lowestEquityPoint.getValue()) {
      lowestEquityPoint = point;
    }
    if (highestEquityPoint == null || pnl > highestEquityPoint.getValue()) {
      highestEquityPoint = point;
View Full Code Here

    this.bottomIndex = bottomIndex;
    this.topIndex = topIndex;
    this.bottomIndexValue = bottomIndexValue;
    this.topIndexValue = topIndexValue;
    this.segment = segment;
    this.points = new SimplePoint[] { new SimplePoint(bottomIndex, bottomIndexValue), new SimplePoint(topIndex, topIndexValue) };
    this.label = label;
  }
View Full Code Here

  public TradePattern(Date executionTime, OrderSide orderSide, double executionPrice, int amount) {
    this.executionTime = executionTime;
    this.orderSide = orderSide;
    this.executionPrice = executionPrice;
    this.amount = amount;
    points = Collections.singletonList((ISeriesPoint<Date, Double>) new SimplePoint(executionTime, executionPrice));
  }
View Full Code Here

TOP

Related Classes of com.quantcomponents.core.series.SimplePoint

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.