TraderList implemented
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, tobias
|
||||
* Copyright (c) 2017, 7u83
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -38,16 +38,15 @@ import sesim.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tobias
|
||||
* @author 7u83
|
||||
*/
|
||||
public class RandomTrader extends AutoTrader {
|
||||
|
||||
|
||||
long event() {
|
||||
|
||||
sesim.Exchange.Account a = se.getAccount(account_id);
|
||||
long rc = this.doTrade();
|
||||
return rc/3;
|
||||
return rc / 3;
|
||||
|
||||
}
|
||||
|
||||
@ -59,12 +58,16 @@ public class RandomTrader extends AutoTrader {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public long timerTask() {
|
||||
sesim.Exchange.Account a = se.getAccount(account_id);
|
||||
sesim.Exchange.Account a = se.getAccount(account_id);
|
||||
long rc = this.doTrade();
|
||||
return rc/33;
|
||||
|
||||
return rc / 33;
|
||||
|
||||
// return this.event();
|
||||
}
|
||||
|
||||
@ -81,13 +84,13 @@ public class RandomTrader extends AutoTrader {
|
||||
|
||||
}
|
||||
|
||||
double start = 0.1;
|
||||
double start = 1.1;
|
||||
//Timer timer = new Timer();
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
|
||||
// timer.schedule(new TimerTaskImpl(this, timer), 0);
|
||||
// timer.schedule(new TimerTaskImpl(this, timer), 0);
|
||||
se.timer.startTimerEvent(this, 0);
|
||||
|
||||
// timer.schedule(new TimerTaskImpl, date);
|
||||
@ -152,7 +155,7 @@ public class RandomTrader extends AutoTrader {
|
||||
OrderType type = OrderType.BID;
|
||||
|
||||
if (ad == null || myconfig == null) {
|
||||
System.out.print(ad + "\n");
|
||||
// System.out.print(ad + "\n");
|
||||
return 0;
|
||||
|
||||
}
|
||||
@ -194,7 +197,7 @@ public class RandomTrader extends AutoTrader {
|
||||
|
||||
// long volume = (long) (money / (limit * 1));
|
||||
if (volume <= 0) {
|
||||
System.out.print("SellVolume 0\n");
|
||||
// System.out.print("SellVolume 0\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -243,6 +246,5 @@ public class RandomTrader extends AutoTrader {
|
||||
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
*/
|
||||
}
|
||||
|
@ -36,12 +36,12 @@ import sesim.Exchange;
|
||||
public class RandomTraderConfig extends AutoTraderConfig {
|
||||
|
||||
public float[] sell_volume = {100, 100};
|
||||
public float[] sell_limit = {-10f, 10f};
|
||||
public float[] sell_limit = {-1f, 1f};
|
||||
public int[] sell_order_wait = {1000, 5000};
|
||||
public int[] wait_after_sell = {10, 30};
|
||||
|
||||
public float[] buy_volume = {100, 100};
|
||||
public float[] buy_limit = {-10, 10f};
|
||||
public float[] buy_limit = {-1, 1f};
|
||||
public int[] buy_order_wait = {1000, 5000};
|
||||
public int[] wait_after_buy = {10, 30};
|
||||
|
||||
|
Reference in New Issue
Block a user