Work on trader editor

This commit is contained in:
7u83
2017-01-30 22:18:10 +01:00
parent e4f85ba418
commit a11cf985a7
24 changed files with 860 additions and 494 deletions

View File

@ -66,7 +66,7 @@ public class RandomTrader extends AutoTrader {
public long timerTask() {
sesim.Exchange.Account a = se.getAccount(account_id);
long rc = this.doTrade();
return rc / 100;
return rc /1;
// return this.event();
}

View File

@ -60,7 +60,7 @@ public class RandomTraderConfig implements AutoTraderConfig {
}
@Override
public String getName() {
public String getDisplayName() {
return "Random A";
}
@ -89,6 +89,7 @@ public class RandomTraderConfig implements AutoTraderConfig {
jo.put(BUY_WAIT, buy_wait);
jo.put(WAIT_AFTER_SELL, wait_after_sell);
jo.put(WAIT_AFTER_BUY, wait_after_buy);
jo.put("base",this.getClass().getCanonicalName());
return jo;
}
@ -135,12 +136,12 @@ public class RandomTraderConfig implements AutoTraderConfig {
return;
}
System.out.printf("Putconfig %s\n", cfg.toString(4));
// System.out.printf("Putconfig %s\n", cfg.toString(4));
String cname = cfg.get(SELL_VOLUME).getClass().getName();
// JSONArray a = cfg.getJSONArray(SELL_VOLUME);
System.out.printf("Array = %s \n", cname);
// System.out.printf("Array = %s \n", cname);
sell_volume = to_float(cfg.getJSONArray(SELL_VOLUME));
buy_volume = to_float(cfg.getJSONArray(BUY_VOLUME));

View File

@ -44,7 +44,7 @@ public class SuperTraderConfig implements AutoTraderConfig{
}
@Override
public String getName() {
public String getDisplayName() {
return "SuperTrader";
}

View File

@ -57,7 +57,7 @@ public class SwitchingTraderConfig extends RandomTraderConfig implements AutoTra
}
@Override
public String getName(){
public String getDisplayName(){
return "SwitchingTrader";
}
}