Included stock symbol in order creation.

This commit is contained in:
2017-12-10 12:52:24 +01:00
parent 0c584c6046
commit 9b86599f03
7 changed files with 43 additions and 20 deletions

View File

@ -191,7 +191,7 @@ public class CreateOrderDialog extends javax.swing.JDialog {
new Thread() {
@Override
public void run() {
Globals.se.createOrder(account.getID(), type, volume, limit);
Globals.se.createOrder(account.getID(), Globals.se.getDefaultStockSymbol(), type, volume, limit);
}
}.start();

View File

@ -176,7 +176,9 @@ public class ManTraderConsole extends javax.swing.JPanel {
System.out.printf("Should buy: %f %f\n",volume,limit);
long createOrder = trader.getSE().createOrder(trader.getAccount().getID(), OrderType.BUYLIMIT, volume, limit);
long createOrder = trader.getSE().createOrder(trader.getAccount().getID(),
trader.getSE().getDefaultStockSymbol(),
OrderType.BUYLIMIT, volume, limit);
System.out.printf("The retval is %d",createOrder);
// this.ordersList.account=this.trader.getAccount();
@ -191,7 +193,9 @@ public class ManTraderConsole extends javax.swing.JPanel {
System.out.printf("Should sell: %f %f\n",volume,limit);
long createOrder = trader.getSE().createOrder(trader.getAccount().getID(), OrderType.SELLLIMIT, volume, limit);
long createOrder = trader.getSE().createOrder(trader.getAccount().getID(),
trader.getSE().getDefaultStockSymbol(),
OrderType.SELLLIMIT, volume, limit);
System.out.printf("The retval is %d",createOrder);
}//GEN-LAST:event_sellButtonActionPerformed
@ -201,7 +205,9 @@ public class ManTraderConsole extends javax.swing.JPanel {
System.out.printf("Should stoploss: %f %f\n",volume,limit);
long createOrder = trader.getSE().createOrder(trader.getAccount().getID(), OrderType.STOPLOSS, volume, limit);
long createOrder = trader.getSE().createOrder(trader.getAccount().getID(),
trader.getSE().getDefaultStockSymbol(),
OrderType.STOPLOSS, volume, limit);
System.out.printf("The retval is %d",createOrder);
}//GEN-LAST:event_stopLossButtonActionPerformed

View File

@ -405,7 +405,7 @@ public class RandomTraderA extends AutoTraderBase implements AccountListener {
// System.out.printf("Buy Order wont work\n");
// return false;
// }
long rc = se.createOrder(account_id, type, volume, limit);
long rc = se.createOrder(account_id, se.getDefaultStockSymbol(),type, volume, limit);
if (rc == -1) {
@ -445,7 +445,7 @@ public class RandomTraderA extends AutoTraderBase implements AccountListener {
// return false;
// }
// System.out.printf("Create a Sell Order %f %f!!!!\n", volume, limit);
long rc = se.createOrder(account_id, type, volume, limit);
long rc = se.createOrder(account_id, se.getDefaultStockSymbol(), type, volume, limit);
return rc != -1;
}

View File

@ -296,7 +296,7 @@ public class RandomTraderB extends AutoTraderBase {
return false;
}
se.createOrder(account_id, type, volume, limit);
se.createOrder(account_id, se.getDefaultStockSymbol(), type, volume, limit);
return true;
@ -334,7 +334,7 @@ public class RandomTraderB extends AutoTraderBase {
return false;
}
se.createOrder(account_id, type, volume, limit);
se.createOrder(account_id, se.getDefaultStockSymbol(), type, volume, limit);
return true;