Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 760 | blopes | 1 | package br.com.robo.model; |
| 2 | |||
| 3 | public class Trade { |
||
| 4 | |||
| 5 | public Integer entryIndex; |
||
| 6 | public Integer exitIndex; |
||
| 7 | public Double entryPrice; |
||
| 8 | public Double exitPrice; |
||
| 9 | public Double qty; |
||
| 10 | |||
| 11 | public Double getPnl() { |
||
| 12 | return (exitPrice - entryPrice) * qty; |
||
| 13 | } |
||
| 14 | |||
| 15 | public Integer getEntryIndex() { |
||
| 16 | return entryIndex; |
||
| 17 | } |
||
| 18 | public void setEntryIndex(Integer entryIndex) { |
||
| 19 | this.entryIndex = entryIndex; |
||
| 20 | } |
||
| 21 | |||
| 22 | public Integer getExitIndex() { |
||
| 23 | return exitIndex; |
||
| 24 | } |
||
| 25 | public void setExitIndex(Integer exitIndex) { |
||
| 26 | this.exitIndex = exitIndex; |
||
| 27 | } |
||
| 28 | |||
| 29 | public Double getEntryPrice() { |
||
| 30 | return entryPrice; |
||
| 31 | } |
||
| 32 | public void setEntryPrice(Double entryPrice) { |
||
| 33 | this.entryPrice = entryPrice; |
||
| 34 | } |
||
| 35 | |||
| 36 | public Double getExitPrice() { |
||
| 37 | return exitPrice; |
||
| 38 | } |
||
| 39 | public void setExitPrice(Double exitPrice) { |
||
| 40 | this.exitPrice = exitPrice; |
||
| 41 | } |
||
| 42 | |||
| 43 | public Double getQty() { |
||
| 44 | return qty; |
||
| 45 | } |
||
| 46 | public void setQty(Double qty) { |
||
| 47 | this.qty = qty; |
||
| 48 | } |
||
| 49 | |||
| 50 | @Override |
||
| 51 | public String toString() { |
||
| 52 | return "Trade{" + |
||
| 53 | "entryIndex=" + entryIndex + |
||
| 54 | ", exitIndex=" + exitIndex + |
||
| 55 | ", entryPrice=" + entryPrice + |
||
| 56 | ", exitPrice=" + exitPrice + |
||
| 57 | ", qty=" + qty + |
||
| 58 | ", pnl=" + getPnl() + |
||
| 59 | '}'; |
||
| 60 | } |
||
| 61 | |||
| 62 | } |