Subversion Repositories Integrator Subversion

Rev

Blame | Last modification | View Log | Download | RSS feed

package br.com.robo.model;

public class Trade {
       
    public Integer entryIndex;
    public Integer exitIndex;
    public Double entryPrice;
    public Double exitPrice;
    public Double qty;

    public Double getPnl() {
        return (exitPrice - entryPrice) * qty;
    }
   
    public Integer getEntryIndex() {
                return entryIndex;
        }
    public void setEntryIndex(Integer entryIndex) {
                this.entryIndex = entryIndex;
        }
   
    public Integer getExitIndex() {
                return exitIndex;
        }
    public void setExitIndex(Integer exitIndex) {
                this.exitIndex = exitIndex;
        }
   
    public Double getEntryPrice() {
                return entryPrice;
        }
    public void setEntryPrice(Double entryPrice) {
                this.entryPrice = entryPrice;
        }
   
    public Double getExitPrice() {
                return exitPrice;
        }
    public void setExitPrice(Double exitPrice) {
                this.exitPrice = exitPrice;
        }
   
    public Double getQty() {
                return qty;
        }
    public void setQty(Double qty) {
                this.qty = qty;
        }

    @Override
    public String toString() {
        return "Trade{" +
                "entryIndex=" + entryIndex +
                ", exitIndex=" + exitIndex +
                ", entryPrice=" + entryPrice +
                ", exitPrice=" + exitPrice +
                ", qty=" + qty +
                ", pnl=" + getPnl() +
                '}';
    }
   
}