示例#1
0
 public static MakeOrderAccount create(
     TradingConsole tradingConsole,
     SettingsManager settingsManager,
     Account account,
     Instrument instrument,
     boolean isForDelivery) {
   return MakeOrderAccount.create(
       tradingConsole, settingsManager, account.get_Id(), instrument.get_Id(), isForDelivery);
 }
示例#2
0
  public void write(long time, Instrument instrument1, Instrument instrument2) {
    double bid1 = instrument1.getBid();
    double ask1 = instrument1.getAsk();
    double bid2 = instrument2.getBid();
    double ask2 = instrument2.getAsk();

    if (bid1 > 0 && ask1 > 0 && bid2 > 0 && ask2 > 0) {
      StringBuilder sb = new StringBuilder();
      sb.append(dateFormat.format(new Date(time))).append(",");
      sb.append(decimalFormat.format(bid1)).append(",");
      sb.append(decimalFormat.format(ask1)).append(",");
      sb.append(decimalFormat.format(bid2)).append(",");
      sb.append(decimalFormat.format(ask2));

      writer.println(sb);
      writer.flush();
    }
  }
示例#3
0
  public void update(String dataSourceKey, boolean isDblClickAsk) {
    if (!this._isForDelivery && this._buySellType == BuySellType.Both) {
      boolean isBuy = Instrument.getSelectIsBuy(this._instrument, isDblClickAsk);

      this._isBuyForCurrent = isBuy;
      this._isBuyForCombo = isBuy ? Language.Buy : Language.Sell;
      TradingConsole.bindingManager.update(dataSourceKey, this);
      this.setStyle(dataSourceKey);

      this._isBuyForCurrent = !isBuy;
      this._isBuyForCombo = (!isBuy) ? Language.Buy : Language.Sell;
      TradingConsole.bindingManager.update(dataSourceKey, this);
      this.setStyle(dataSourceKey);
    } else {
      TradingConsole.bindingManager.update(dataSourceKey, this);
      this.setStyle(dataSourceKey);
    }
  }