⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 profitandloss.java

📁 网上期货交易的外挂原码,可实现自动交易功能,自动添加模块
💻 JAVA
字号:
package com.jsystemtrader.performance;

import java.text.*;
import java.util.*;

/**
 * Encapsulates P&L information.
 */
public class ProfitAndLoss {

    private static final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss MM/dd/yy");

    private final long date;
    private final double value;

    public ProfitAndLoss(long date, double value) {
        this.date = date;
        this.value = value;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer();
        sb.append(" date: " + getShortDate());
        sb.append(" value: " + value);

        return sb.toString();
    }

    public double getValue() {
        return value;
    }

    public long getDate() {
        return date;
    }

    public String getShortDate() {
        String formattedDate = dateFormat.format(new Date(date));
        return formattedDate.toString();
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -