Fixed stop loss calculation

This commit is contained in:
7u83
2019-01-04 08:29:45 +01:00
parent b193d69f52
commit b5c6d45f66
7 changed files with 74 additions and 31 deletions

View File

@ -607,11 +607,12 @@ public class SeSimApplication extends javax.swing.JFrame {
+ "strategy: opensesim.world.SimpleTrader"
+ "}");
Trader t = godworld.createTrader(cfg);
t.start();
t.start();
AccountDialog.runDialog(this, ((SimpleTrader)t).account_1);
AccountDialog.runDialog(this, ((SimpleTrader)t).account_b);
updateGodWorld(godworld);
AssetPair p = godworld.getDefaultAssetPair();

View File

@ -47,6 +47,7 @@ public class AccountDialog extends javax.swing.JDialog {
d=new AccountDialog(parent, false);
d.accountPanel1.account=account;
d.accountPanel1.update();
account.addListener(d.accountPanel1);
d.setVisible(true);
}

View File

@ -72,12 +72,18 @@ public class AccountPanel extends javax.swing.JPanel implements EventListener {
// model.setValueAt(ob1.getAccount().getOwner().getName(), row, 0);
model.setValueAt(a.getSymbol(), row, 0);
model.setValueAt(astr, row, 1);
model.setValueAt(mastr, row, 2);
// model.setValueAt(mastr, row, 2);
model.setValueAt(sl.toString(), row, 3);
row++;
}
this.finalbalance.setText(account.getFinalBalance().toString());
String fb;
Double margin = account.getMargin(account.getWorld().getDefaultCurrency());
fb = account.getFinalBalance().toString() + " Margin: " +
margin.toString();
this.finalbalance.setText(fb);
}
/**