Fixed stop loss calculation
This commit is contained in:
@ -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();
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user