當前位置:股票大全官網 - 股票投資 - 自動股票交易java

自動股票交易java

公共類別股票{

私有字符串存儲;//股票類別屬性

私有字符串符號;//股票代碼

私有字符串名稱;//股票名稱

私有BigDecimal currentPrice//當前時間的股票價格

私有BigDecimal previouClosingPrice//前壹天的股票價值

/**

*返回前壹天更改為當前時間的百分比。

* @退貨百分比

*/

public double getchangepcent(){

返回this . current price . subtract(this . previouclosingprice)。abs()

。divide(this.currentPrice,2,BigDecimal。ROUND_HALF_EVEN)

。double value();

}

/**

*返回前壹天更改為當前時間的百分比。

* @param currentPrice當前時間的股票價格。

* @ param previouClosingPrice前壹天的股票價值

* @退貨百分比

*/

public double getchangepcent(BigDecimal current price,

BigDecimal previous price){

返回current price . subtract(previous closing price)。abs()

。divide(currentPrice,2,BigDecimal。ROUND_HALF_EVEN)

。double value();

}

公共字符串getStore() {

退貨店;

}

公共void setStore(字符串存儲){

this.store = store

}

公共字符串getSymbol() {

返回符號;

}

public void setSymbol(字符串符號){

this.symbol = symbol

}

公共字符串getName() {

返回名稱;

}

public void setName(字符串名){

this.name = name

}

public BigDecimal getCurrentPrice(){

返回當前價格;

}

public void setCurrentPrice(BigDecimal currentPrice){

this . current price = current price;

}

public BigDecimal getPreviouClosingPrice(){

返回前成交價格;

}

public void setPreviouClosingPrice(BigDecimal previouClosingPrice){

this . previouClosingPrice = previouClosingPrice;

}

}