package com.crm.rely.backend.core.pojo.table;

import com.crm.rely.backend.core.pojo.BaseTable;
import lombok.Data;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * @Description 比赛每日记录表
 * @Author y
 * @Date 2023/3/24 14:58
 */
@Data
@Entity
@Table(name = "follow_deal_score_daily")
public class FollowDealScoreDailyTable extends BaseTable {

    private Long customId;

    private Long cId;

    private Long login;
    /**
     * 比赛记录表
     */
    private Long periodId;
    /**
     * 当日净值（计算后） Pn
     */
    private Float currentCumulativeEquity;
    /**
     * 累计净值
     */
    private Float cumulativeEquity;
    /**
     * 最大累计净值
     */
    private Float maxCumulativeEquity;
    /**
     * 当日净值,当日权益
     */
    private Float currentEquity;
    /**
     * 当日盈亏
     */
    private Float currentProfit;
    /**
     * 当日手续费
     * 仓息+佣金
     */
    private Float currentFee;
    /**
     * 上日权益
     */
    private Float prevEquity;
    /**
     * 当日入金
     */
    private Float currentDeposit;
    /**
     * 总入金
     */
    private Float totalDeposit;
    /**
     * 当日出金
     */
    private Float currentWithdrawal;
    /**
     * 总出金
     */
    private Float totalWithdrawal;
    /**
     * 账户累计净值得分
     */
    private Float cumulativeEquityScore;
    /**
     * 盈亏率=当日净利润
     */
    private Float profitRate;
    /**
     * 盈利率
     * （总投收益：期末净值-期初净值+出金）/（总投入：期初净值+入金）
     */
    private Float profitRatio;

    /**
     * 起始资金
     */
    private Float startingCapital;
    /**
     * 最大本金收益率
     */
    private Float principalRate;
    /**
     * 本金收益率得分
     */
    private Float principalScore;
    /**
     * 回撤率
     */
    private Float withdrawalRate;
    /**
     * 最大回撤率
     */
    private Float maxWithdrawalRate;
    /**
     * 最大亏损订单的额度
     */
    private Float maxLoss;
    /**
     * 平仓总盈亏,累计净利润
     */
    private Float totalProfit;
    /**
     * 最大回撤率得分
     */
    private Float withdrawalScore;
    /**
     * 累计净利润得分
     */
    private Float cumulativeProfitScore;
    /**
     * 订单数
     */
    private Integer tradeCount;
    /**
     * 手数
     */
    private Float volume;
    /**
     * 有效手数，持仓3分钟以上
     */
    private Float raceVolume;
    /**
     * 手数得分
     */
    private Float volumeScore;

    private Date date;

    private Date startDate;

    private Date endDate;

    private Float startEquity;
    /**
     * 当前周期是否结束
     */
    private Integer isPeriodEnd;

    private Integer periodType;

    public static FollowDealScoreDailyTable getInstance() {
        FollowDealScoreDailyTable table = new FollowDealScoreDailyTable();
        table.setCurrentCumulativeEquity(1F);
        table.setCumulativeEquity(1F);
        table.setCumulativeEquityScore(0F);
        table.setCurrentEquity(0F);
        table.setCurrentFee(0F);
        table.setCurrentDeposit(0F);
        table.setCurrentWithdrawal(0F);
        table.setProfitRate(0F);
        table.setStartingCapital(0F);
        table.setPrincipalRate(0F);
        table.setPrincipalScore(0F);
        table.setMaxLoss(0F);
        table.setWithdrawalRate(0F);
        table.setWithdrawalScore(0F);
        table.setCumulativeProfitScore(0F);
        table.setTotalProfit(0F);
        table.setPrevEquity(0F);
        table.setCurrentProfit(0F);
        table.setTradeCount(0);
        table.setVolume(0F);
        table.setMaxCumulativeEquity(1F);
        table.setMaxWithdrawalRate(0F);
        table.setTotalDeposit(0F);
        table.setTotalWithdrawal(0F);
        table.setRaceVolume(0F);
        table.setStartEquity(0F);
        table.setVolumeScore(0F);
        table.setIsPeriodEnd(0);
        table.setProfitRatio(0F);
        return table;
    }


}
