Added ERROR status and message String with getter and setter
This commit is contained in:
parent
0cedbbc3d4
commit
fcdae01a8b
@ -42,6 +42,8 @@ public class Account {
|
|||||||
|
|
||||||
HashMap<AbstractAsset, Double> assets = new HashMap<>();
|
HashMap<AbstractAsset, Double> assets = new HashMap<>();
|
||||||
HashMap<AbstractAsset, Double> assets_avail = new HashMap<>();
|
HashMap<AbstractAsset, Double> assets_avail = new HashMap<>();
|
||||||
|
|
||||||
|
public double margin_bound=0.0;
|
||||||
|
|
||||||
Trader owner;
|
Trader owner;
|
||||||
//public Exchange exchange = null;
|
//public Exchange exchange = null;
|
||||||
@ -93,7 +95,7 @@ public class Account {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Double getMargin(AbstractAsset currency) {
|
public Double getMargin(AbstractAsset currency) {
|
||||||
return this.getFinalBalance(currency) * getLeverage()
|
return this.getFinalBalance(currency) * getLeverage() + this.getFinalBalance(currency)
|
||||||
- this.getAssetDebt(world.getDefaultExchange(), currency);
|
- this.getAssetDebt(world.getDefaultExchange(), currency);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -209,7 +211,7 @@ public class Account {
|
|||||||
* @return Balance
|
* @return Balance
|
||||||
*/
|
*/
|
||||||
public Double getFinalBalance() {
|
public Double getFinalBalance() {
|
||||||
return getFinalBalance(world.getDefaultAssetPair().getCurrency());
|
return getFinalBalance(world.getDefaultCurrency());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Double calcStopLoss(Exchange ex, AbstractAsset asset, AbstractAsset currency) {
|
public Double calcStopLoss(Exchange ex, AbstractAsset asset, AbstractAsset currency) {
|
||||||
|
Loading…
Reference in New Issue
Block a user