display caclulated stop loss (for test only)
This commit is contained in:
parent
641285fafb
commit
0177510961
@ -23,18 +23,12 @@
|
|||||||
<Layout>
|
<Layout>
|
||||||
<DimensionLayout dim="0">
|
<DimensionLayout dim="0">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="1" attributes="0">
|
<Component id="accountPanel1" alignment="1" max="32767" attributes="0"/>
|
||||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
|
||||||
<Component id="accountPanel1" min="-2" pref="400" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
<DimensionLayout dim="1">
|
<DimensionLayout dim="1">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Component id="accountPanel1" alignment="0" pref="300" max="32767" attributes="0"/>
|
||||||
<Component id="accountPanel1" min="-2" pref="228" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace min="0" pref="72" max="32767" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
@ -67,15 +67,11 @@ public class AccountDialog extends javax.swing.JDialog {
|
|||||||
getContentPane().setLayout(layout);
|
getContentPane().setLayout(layout);
|
||||||
layout.setHorizontalGroup(
|
layout.setHorizontalGroup(
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
.addComponent(accountPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
.addGap(0, 0, Short.MAX_VALUE)
|
|
||||||
.addComponent(accountPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE))
|
|
||||||
);
|
);
|
||||||
layout.setVerticalGroup(
|
layout.setVerticalGroup(
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addComponent(accountPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
|
||||||
.addComponent(accountPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 228, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
||||||
.addGap(0, 72, Short.MAX_VALUE))
|
|
||||||
);
|
);
|
||||||
|
|
||||||
pack();
|
pack();
|
||||||
|
@ -17,11 +17,26 @@
|
|||||||
<DimensionLayout dim="0">
|
<DimensionLayout dim="0">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Component id="jScrollPane1" alignment="0" pref="400" max="32767" attributes="0"/>
|
<Component id="jScrollPane1" alignment="0" pref="400" max="32767" attributes="0"/>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
|
<Component id="finalbalance" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
<DimensionLayout dim="1">
|
<DimensionLayout dim="1">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Component id="jScrollPane1" alignment="0" pref="300" max="32767" attributes="0"/>
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="jScrollPane1" min="-2" pref="214" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" pref="32" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="finalbalance" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace min="0" pref="32" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
</Layout>
|
</Layout>
|
||||||
@ -36,10 +51,11 @@
|
|||||||
<Component class="javax.swing.JTable" name="assetTable">
|
<Component class="javax.swing.JTable" name="assetTable">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
|
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
|
||||||
<Table columnCount="3" rowCount="2">
|
<Table columnCount="4" rowCount="2">
|
||||||
<Column editable="false" title="Asset" type="java.lang.String"/>
|
<Column editable="false" title="Asset" type="java.lang.String"/>
|
||||||
<Column editable="false" title="Ammount" type="java.lang.String"/>
|
<Column editable="false" title="Ammount" type="java.lang.String"/>
|
||||||
<Column editable="false" title="Margin" type="java.lang.String"/>
|
<Column editable="false" title="Margin" type="java.lang.String"/>
|
||||||
|
<Column editable="false" title="SL" type="java.lang.String"/>
|
||||||
</Table>
|
</Table>
|
||||||
</Property>
|
</Property>
|
||||||
<Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor">
|
<Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor">
|
||||||
@ -63,5 +79,15 @@
|
|||||||
</Component>
|
</Component>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Container>
|
</Container>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Final:"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="finalbalance">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="jLabel2"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Form>
|
</Form>
|
||||||
|
@ -66,13 +66,18 @@ public class AccountPanel extends javax.swing.JPanel implements EventListener {
|
|||||||
Double mavail = account.getAvail(a);
|
Double mavail = account.getAvail(a);
|
||||||
String mastr = mval.toString(); // + "/" + mavail.toString();
|
String mastr = mval.toString(); // + "/" + mavail.toString();
|
||||||
|
|
||||||
|
|
||||||
|
Double sl = account.calcStopLoss(a);
|
||||||
|
|
||||||
// model.setValueAt(ob1.getAccount().getOwner().getName(), row, 0);
|
// model.setValueAt(ob1.getAccount().getOwner().getName(), row, 0);
|
||||||
model.setValueAt(a.getSymbol(), row, 0);
|
model.setValueAt(a.getSymbol(), row, 0);
|
||||||
model.setValueAt(astr, row, 1);
|
model.setValueAt(astr, row, 1);
|
||||||
model.setValueAt(mastr, row, 2);
|
model.setValueAt(mastr, row, 2);
|
||||||
|
model.setValueAt(sl.toString(), row, 3);
|
||||||
row++;
|
row++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.finalbalance.setText(account.getFinalBalance().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -86,21 +91,23 @@ public class AccountPanel extends javax.swing.JPanel implements EventListener {
|
|||||||
|
|
||||||
jScrollPane1 = new javax.swing.JScrollPane();
|
jScrollPane1 = new javax.swing.JScrollPane();
|
||||||
assetTable = new javax.swing.JTable();
|
assetTable = new javax.swing.JTable();
|
||||||
|
jLabel1 = new javax.swing.JLabel();
|
||||||
|
finalbalance = new javax.swing.JLabel();
|
||||||
|
|
||||||
assetTable.setModel(new javax.swing.table.DefaultTableModel(
|
assetTable.setModel(new javax.swing.table.DefaultTableModel(
|
||||||
new Object [][] {
|
new Object [][] {
|
||||||
{null, null, null},
|
{null, null, null, null},
|
||||||
{null, null, null}
|
{null, null, null, null}
|
||||||
},
|
},
|
||||||
new String [] {
|
new String [] {
|
||||||
"Asset", "Ammount", "Margin"
|
"Asset", "Ammount", "Margin", "SL"
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
Class[] types = new Class [] {
|
Class[] types = new Class [] {
|
||||||
java.lang.String.class, java.lang.String.class, java.lang.String.class
|
java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
|
||||||
};
|
};
|
||||||
boolean[] canEdit = new boolean [] {
|
boolean[] canEdit = new boolean [] {
|
||||||
false, false, false
|
false, false, false, false
|
||||||
};
|
};
|
||||||
|
|
||||||
public Class getColumnClass(int columnIndex) {
|
public Class getColumnClass(int columnIndex) {
|
||||||
@ -113,21 +120,39 @@ public class AccountPanel extends javax.swing.JPanel implements EventListener {
|
|||||||
});
|
});
|
||||||
jScrollPane1.setViewportView(assetTable);
|
jScrollPane1.setViewportView(assetTable);
|
||||||
|
|
||||||
|
jLabel1.setText("Final:");
|
||||||
|
|
||||||
|
finalbalance.setText("jLabel2");
|
||||||
|
|
||||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||||
this.setLayout(layout);
|
this.setLayout(layout);
|
||||||
layout.setHorizontalGroup(
|
layout.setHorizontalGroup(
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addComponent(jLabel1)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||||
|
.addComponent(finalbalance)
|
||||||
|
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||||
);
|
);
|
||||||
layout.setVerticalGroup(
|
layout.setVerticalGroup(
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 214, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addGap(32, 32, 32)
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(jLabel1)
|
||||||
|
.addComponent(finalbalance))
|
||||||
|
.addGap(0, 32, Short.MAX_VALUE))
|
||||||
);
|
);
|
||||||
}// </editor-fold>//GEN-END:initComponents
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
private javax.swing.JTable assetTable;
|
private javax.swing.JTable assetTable;
|
||||||
|
private javax.swing.JLabel finalbalance;
|
||||||
|
private javax.swing.JLabel jLabel1;
|
||||||
private javax.swing.JScrollPane jScrollPane1;
|
private javax.swing.JScrollPane jScrollPane1;
|
||||||
// End of variables declaration//GEN-END:variables
|
// End of variables declaration//GEN-END:variables
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user