Interface improved
This commit is contained in:
@ -64,10 +64,12 @@ public class RandomTrader extends AutoTrader {
|
||||
public Event event;
|
||||
public long time;
|
||||
|
||||
NextEvent(Event e, long time) {
|
||||
/* NextEvent(Event e, long time) {
|
||||
this.event = e;
|
||||
this.time = time;
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
public RandomTrader(Exchange se, double money, double shares, RandomTraderConfig config) {
|
||||
@ -171,7 +173,7 @@ public class RandomTrader extends AutoTrader {
|
||||
double money = getRandomAmmount(ad.money, myconfig.buy_volume);
|
||||
|
||||
Quote q = se.getCurrentPrice();
|
||||
double lp = q == null ? 0.0001 : q.price;
|
||||
double lp = q == null ? 1.0 : q.price;
|
||||
|
||||
|
||||
|
||||
@ -208,7 +210,7 @@ public class RandomTrader extends AutoTrader {
|
||||
// double lp = 100.0; //se.getBestLimit(type);
|
||||
|
||||
Quote q = se.getCurrentPrice();
|
||||
double lp = q == null ? 0.1 : q.price;
|
||||
double lp = q == null ? 1.0 : q.price;
|
||||
|
||||
|
||||
double limit;
|
||||
@ -263,6 +265,7 @@ public class RandomTrader extends AutoTrader {
|
||||
public void run() {
|
||||
|
||||
long time = trader.event();
|
||||
time/=50;
|
||||
|
||||
this.cancel();
|
||||
Exchange.timer.schedule(new TimerTaskImpl(trader), time);
|
||||
|
@ -36,12 +36,12 @@ import sesim.Exchange;
|
||||
public class RandomTraderConfig extends AutoTraderConfig {
|
||||
|
||||
public float[] sell_volume = {100, 100};
|
||||
public float[] sell_limit = {-1, 0};
|
||||
public float[] sell_limit = {-1.0f, 1.0f};
|
||||
public int[] sell_order_wait = {1, 5};
|
||||
public int[] wait_after_sell = {10, 30};
|
||||
|
||||
public float[] buy_volume = {100, 100};
|
||||
public float[] buy_limit = {0, 1};
|
||||
public float[] buy_limit = {-1.0f, 1f};
|
||||
public int[] buy_order_wait = {1, 5};
|
||||
public int[] wait_after_buy = {10, 30};
|
||||
|
||||
|
Reference in New Issue
Block a user