new AutoTraderInterface
This commit is contained in:
@ -39,7 +39,7 @@ import sesim.Exchange;
|
||||
*
|
||||
* @author 7u83 <7u83@mail.ru>
|
||||
*/
|
||||
public class ManTrader extends AutoTraderBase implements AutoTraderConfig {
|
||||
public class ManTrader extends AutoTraderBase {
|
||||
|
||||
public ManTrader(Exchange se, long id, String name, double money, double shares, AutoTraderConfig config) {
|
||||
// super(se, id, name, money, shares, null);
|
||||
@ -74,11 +74,12 @@ public class ManTrader extends AutoTraderBase implements AutoTraderConfig {
|
||||
return 1000;
|
||||
}
|
||||
|
||||
@Override
|
||||
/* @Override
|
||||
public AutoTrader createTrader(Exchange se, JSONObject cfg, long id, String name, double money, double shares) {
|
||||
return null;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return null;
|
||||
|
@ -48,10 +48,6 @@ public class ManTraderConfig extends AutoTraderBase{
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
public AutoTrader createTrader(Exchange se, JSONObject cfg, long id, String name, double money, double shares) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
|
@ -28,6 +28,7 @@ package traders.ManTrader;
|
||||
import gui.OrdersList;
|
||||
import javax.swing.JTable;
|
||||
import sesim.AutoTrader;
|
||||
import sesim.AutoTraderInterface;
|
||||
import sesim.Exchange;
|
||||
|
||||
/**
|
||||
@ -36,7 +37,7 @@ import sesim.Exchange;
|
||||
*/
|
||||
public class ManTraderConsole extends javax.swing.JPanel {
|
||||
|
||||
public AutoTrader trader;
|
||||
public ManTrader trader;
|
||||
|
||||
public OrdersList getOrderListPanel(){
|
||||
return this.ordersList1;
|
||||
|
@ -28,6 +28,7 @@ package traders;
|
||||
import gui.Globals;
|
||||
import java.util.*;
|
||||
import java.util.Random;
|
||||
import org.json.JSONObject;
|
||||
//import java.util.TimerTask;
|
||||
/*import sesim.AccountData;*/
|
||||
|
||||
@ -42,15 +43,19 @@ import sesim.*;
|
||||
* @author 7u83
|
||||
*/
|
||||
public class RandomTrader extends AutoTrader {
|
||||
|
||||
|
||||
|
||||
|
||||
long event() {
|
||||
/* long event() {
|
||||
|
||||
sesim.Exchange.Account a = se.getAccount(account_id);
|
||||
long rc = this.doTrade();
|
||||
return rc;
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
public RandomTrader(Exchange se, long id, String name, double money, double shares, RandomTraderConfig config) {
|
||||
super(se, id, name,money, shares, config);
|
||||
if (this.config == null) {
|
||||
@ -73,6 +78,8 @@ public class RandomTrader extends AutoTrader {
|
||||
// return this.event();
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected enum Action {
|
||||
BUY, SELL, RANDOM
|
||||
}
|
||||
|
309
src/main/java/traders/RandomTraderA.java
Normal file
309
src/main/java/traders/RandomTraderA.java
Normal file
@ -0,0 +1,309 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 7u83 <7u83@mail.ru>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package traders;
|
||||
|
||||
import gui.Globals;
|
||||
import java.util.Iterator;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import sesim.AccountData;
|
||||
import sesim.AutoTrader;
|
||||
import sesim.AutoTraderBase;
|
||||
import sesim.AutoTraderConfig;
|
||||
import sesim.AutoTraderGui;
|
||||
import sesim.Exchange;
|
||||
import sesim.OrderData;
|
||||
import sesim.Quote;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author 7u83 <7u83@mail.ru>
|
||||
*/
|
||||
public class RandomTraderA extends AutoTraderBase {
|
||||
|
||||
public Float[] sell_volume = {100f, 100f};
|
||||
public Float[] sell_limit = {-2f, 2f};
|
||||
public Long[] sell_wait = {10000L, 50000L};
|
||||
public Long[] wait_after_sell = {1000L, 30000L};
|
||||
|
||||
public Float[] buy_volume = {100f, 100f};
|
||||
public Float[] buy_limit = {-2f, 2f};
|
||||
public Long[] buy_wait = {10000L, 50000L};
|
||||
public Long[] wait_after_buy = {10L, 30L};
|
||||
|
||||
final String SELL_VOLUME = "sell_volume";
|
||||
final String BUY_VOLUME = "buy_volume";
|
||||
final String SELL_LIMIT = "sell_limit";
|
||||
final String BUY_LIMIT = "buy_limit";
|
||||
final String SELL_WAIT = "sell_wait";
|
||||
final String BUY_WAIT = "buy_wait";
|
||||
final String WAIT_AFTER_SELL = "sell_wait_after";
|
||||
final String WAIT_AFTER_BUY = "buy_wait_after";
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
se.timer.startTimerEvent(this, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long timerTask() {
|
||||
sesim.Exchange.Account a = se.getAccount(account_id);
|
||||
long rc = this.doTrade();
|
||||
return rc;
|
||||
|
||||
}
|
||||
|
||||
/* @Override
|
||||
public AutoTrader createTrader(Exchange se, JSONObject cfg, long id, String name, double money, double shares) {
|
||||
return null;
|
||||
}
|
||||
*/
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AutoTraderGui getGui() {
|
||||
return new RandomTraderGuiA(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getConfig() {
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put(SELL_VOLUME, sell_volume);
|
||||
jo.put(BUY_VOLUME, buy_volume);
|
||||
jo.put(SELL_LIMIT, sell_limit);
|
||||
jo.put(BUY_LIMIT, buy_limit);
|
||||
jo.put(SELL_WAIT, sell_wait);
|
||||
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;
|
||||
}
|
||||
|
||||
private Float[] to_float(JSONArray a) {
|
||||
Float[] ret = new Float[a.length()];
|
||||
for (int i = 0; i < a.length(); i++) {
|
||||
ret[i] = new Float(a.getDouble(i));
|
||||
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
private Long[] to_long(JSONArray a) {
|
||||
Long[] ret = new Long[a.length()];
|
||||
for (int i = 0; i < a.length(); i++) {
|
||||
ret[i] = a.getLong(i);
|
||||
|
||||
}
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putConfig(JSONObject cfg) {
|
||||
if (cfg == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
String cname = cfg.get(SELL_VOLUME).getClass().getName();
|
||||
|
||||
sell_volume = to_float(cfg.getJSONArray(SELL_VOLUME));
|
||||
buy_volume = to_float(cfg.getJSONArray(BUY_VOLUME));
|
||||
sell_limit = to_float(cfg.getJSONArray(SELL_LIMIT));
|
||||
buy_limit = to_float(cfg.getJSONArray(BUY_LIMIT));
|
||||
sell_wait = to_long(cfg.getJSONArray(SELL_WAIT));
|
||||
buy_wait = to_long(cfg.getJSONArray(BUY_WAIT));
|
||||
|
||||
wait_after_sell = to_long(cfg.getJSONArray(WAIT_AFTER_SELL));
|
||||
wait_after_buy = to_long(cfg.getJSONArray(WAIT_AFTER_BUY));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getDevelStatus() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public long cancelOrders() {
|
||||
int n = se.getNumberOfOpenOrders(account_id);
|
||||
if (n > 0) {
|
||||
AccountData ad = se.getAccountData(account_id);
|
||||
Iterator<OrderData> it = ad.orders.iterator();
|
||||
while (it.hasNext()) {
|
||||
OrderData od = it.next();
|
||||
boolean rc = se.cancelOrder(account_id, od.id);
|
||||
}
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
protected enum Action {
|
||||
BUY, SELL, RANDOM
|
||||
}
|
||||
|
||||
protected Action getAction() {
|
||||
if (se.randNextInt(2) == 0) {
|
||||
return Action.BUY;
|
||||
} else {
|
||||
return Action.SELL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
long doTrade() {
|
||||
cancelOrders();
|
||||
Action a = getAction();
|
||||
switch (a) {
|
||||
case BUY:
|
||||
return doBuy() + 1;
|
||||
case SELL:
|
||||
return doSell() + 1;
|
||||
|
||||
}
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a (long) random number between min an max
|
||||
*
|
||||
* @param min minimum value
|
||||
* @param max maximeum value
|
||||
* @return the number
|
||||
*/
|
||||
protected double getRandom(double min, double max) {
|
||||
double r = se.randNextDouble();
|
||||
|
||||
// System.out.printf("RD: %f", r);
|
||||
// System.exit(0);
|
||||
return (max - min) * r + min;
|
||||
}
|
||||
|
||||
protected int getRandom(Long[] minmax) {
|
||||
return (int) Math.round(getRandom(minmax[0], minmax[1]));
|
||||
}
|
||||
|
||||
double getStart() {
|
||||
return Globals.se.fairValue;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param val
|
||||
* @param minmax
|
||||
* @return
|
||||
*/
|
||||
protected double getRandomAmmount(double val, Float[] minmax) {
|
||||
|
||||
//System.out.printf("RandomAmmount: %f (%f,%f)\n",val, minmax[0], minmax[1]);
|
||||
double min = val * minmax[0] / 100.0;
|
||||
double max = val * minmax[1] / 100.0;
|
||||
return getRandom(min, max);
|
||||
}
|
||||
|
||||
public long doBuy() {
|
||||
|
||||
// RandomTraderConfig myoldconfig = (RandomTraderConfig) this.oldconfig;
|
||||
AccountData ad = this.se.getAccountData(account_id);
|
||||
|
||||
Exchange.OrderType type = Exchange.OrderType.BUYLIMIT;
|
||||
|
||||
if (ad == null) {
|
||||
//System.out.printf("%s: myconf = 0 \n", this.getName());
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
// how much money we ant to invest?
|
||||
double money = getRandomAmmount(ad.money, buy_volume);
|
||||
|
||||
Quote q = se.getCurrentPrice();
|
||||
double lp = q == null ? getStart() : q.price;
|
||||
|
||||
double limit;
|
||||
limit = lp + getRandomAmmount(lp, buy_limit);
|
||||
|
||||
// 10
|
||||
// 24 13
|
||||
// System.out.printf("MyLimit: %f\n",limit);
|
||||
long volume = (long) (money / limit);
|
||||
|
||||
if (volume <= 0) {
|
||||
|
||||
volume = 1;
|
||||
limit = money;
|
||||
|
||||
}
|
||||
|
||||
// double volume = (money / (limit * 1));
|
||||
// if (volume <= 0) {
|
||||
// return 0;
|
||||
// }
|
||||
//System.out.printf("%s: create order %s %f\n", this.getName(),type.toString(),limit);
|
||||
se.createOrder(account_id, type, volume, limit);
|
||||
|
||||
return getRandom(buy_wait);
|
||||
|
||||
}
|
||||
|
||||
public long doSell() {
|
||||
// RandomTraderConfig myoldconfig = (RandomTraderConfig) this.oldconfig;
|
||||
AccountData ad = this.se.getAccountData(account_id);
|
||||
|
||||
Exchange.OrderType type = Exchange.OrderType.SELLLIMIT;
|
||||
|
||||
//System.out.printf("%s: calling rand for volume\n", this.getName());
|
||||
// how much money we ant to envest?
|
||||
double volume = (long) getRandomAmmount(ad.shares, sell_volume);
|
||||
|
||||
// double lp = 100.0; //se.getBestLimit(type);
|
||||
Quote q = se.getCurrentPrice();
|
||||
double lp = q == null ? getStart() : q.price;
|
||||
|
||||
double limit;
|
||||
limit = lp + getRandomAmmount(lp, sell_limit);
|
||||
|
||||
// long volume = (long) (money / (limit * 1));
|
||||
if (volume <= 0) {
|
||||
// System.out.print("SellVolume 0\n");
|
||||
return 5000;
|
||||
}
|
||||
|
||||
// System.out.print("Volume is:"+volume+"\n");
|
||||
// System.out.print("My Ammount is: "+volume+" My limit si:"+limit+ "\n");
|
||||
//System.out.printf("%s: create order %s %f\n", this.getName(),type.toString(),limit);
|
||||
se.createOrder(account_id, type, volume, limit);
|
||||
|
||||
return getRandom(sell_wait);
|
||||
|
||||
}
|
||||
|
||||
}
|
465
src/main/java/traders/RandomTraderGuiA.form
Normal file
465
src/main/java/traders/RandomTraderGuiA.form
Normal file
@ -0,0 +1,465 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<NonVisualComponents>
|
||||
<Component class="javax.swing.JTextField" name="jTextField1">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="jTextField1"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</NonVisualComponents>
|
||||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="null"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="jLabel24" max="32767" attributes="0"/>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Component id="jLabel22" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="jLabel23" max="32767" attributes="0"/>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Component id="jLabel21" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="waitAfterSellMin" alignment="0" min="-2" pref="98" max="-2" attributes="0"/>
|
||||
<Component id="waitAfterBuyMin" alignment="0" min="-2" pref="98" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="jLabel19" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel20" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="waitAfterSellMax" alignment="0" min="-2" pref="98" max="-2" attributes="0"/>
|
||||
<Component id="waitAfterBuyMax" alignment="0" min="-2" pref="98" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="jLabel9" max="32767" attributes="0"/>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="jLabel12" max="32767" attributes="0"/>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Component id="jLabel8" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="jLabel10" pref="175" max="32767" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="18" max="-2" attributes="0"/>
|
||||
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="jLabel11" max="32767" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="18" max="-2" attributes="0"/>
|
||||
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="jLabel18" max="32767" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="18" max="-2" attributes="0"/>
|
||||
<Component id="jLabel17" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="jLabel15" max="32767" attributes="0"/>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Component id="jLabel16" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" max="-2" attributes="0">
|
||||
<Component id="sellVolMin" alignment="1" min="-2" pref="98" max="-2" attributes="0"/>
|
||||
<Component id="buyVolMin" alignment="1" min="-2" pref="98" max="-2" attributes="0"/>
|
||||
<Component id="sellLimitMin" alignment="1" min="-2" pref="98" max="-2" attributes="0"/>
|
||||
<Component id="buyLimitMin" alignment="1" min="-2" pref="98" max="-2" attributes="0"/>
|
||||
<Component id="buyWaitMin" alignment="1" min="-2" pref="98" max="-2" attributes="0"/>
|
||||
<Component id="sellWaitMin" alignment="1" min="-2" pref="98" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="jLabel13" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel14" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="sellWaitMax" min="-2" pref="98" max="-2" attributes="0"/>
|
||||
<Component id="buyWaitMax" min="-2" pref="98" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="jLabel5" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel6" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="sellLimitMax" alignment="0" min="-2" pref="98" max="-2" attributes="0"/>
|
||||
<Component id="buyLimitMax" alignment="0" min="-2" pref="98" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="sellVolMax" alignment="0" min="-2" pref="98" max="-2" attributes="0"/>
|
||||
<Component id="buyVolMax" alignment="0" min="-2" pref="98" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace min="43" pref="43" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="-2" pref="40" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="buyVolMin" alignment="3" min="-2" pref="28" max="-2" attributes="0"/>
|
||||
<Component id="buyVolMax" alignment="3" min="-2" pref="28" max="-2" attributes="0"/>
|
||||
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel9" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="sellVolMin" alignment="3" min="-2" pref="28" max="-2" attributes="0"/>
|
||||
<Component id="sellVolMax" alignment="3" min="-2" pref="28" max="-2" attributes="0"/>
|
||||
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel10" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="buyLimitMin" alignment="3" min="-2" pref="28" max="-2" attributes="0"/>
|
||||
<Component id="buyLimitMax" alignment="3" min="-2" pref="28" max="-2" attributes="0"/>
|
||||
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel11" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="sellLimitMin" alignment="3" min="-2" pref="28" max="-2" attributes="0"/>
|
||||
<Component id="sellLimitMax" alignment="3" min="-2" pref="28" max="-2" attributes="0"/>
|
||||
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel12" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="35" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="buyWaitMax" alignment="3" min="-2" pref="28" max="-2" attributes="0"/>
|
||||
<Component id="jLabel13" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel16" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel15" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buyWaitMin" alignment="3" min="-2" pref="28" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="sellWaitMin" alignment="3" min="-2" pref="28" max="-2" attributes="0"/>
|
||||
<Component id="sellWaitMax" alignment="3" min="-2" pref="28" max="-2" attributes="0"/>
|
||||
<Component id="jLabel14" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel17" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel18" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="waitAfterBuyMin" alignment="3" min="-2" pref="28" max="-2" attributes="0"/>
|
||||
<Component id="waitAfterBuyMax" alignment="3" min="-2" pref="28" max="-2" attributes="0"/>
|
||||
<Component id="jLabel19" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel21" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel23" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="waitAfterSellMin" alignment="3" min="-2" pref="28" max="-2" attributes="0"/>
|
||||
<Component id="waitAfterSellMax" alignment="3" min="-2" pref="28" max="-2" attributes="0"/>
|
||||
<Component id="jLabel20" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel22" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel24" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="37" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JSpinner" name="buyWaitMin">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" minimum="0" numberType="java.lang.Long" stepSize="1000" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="sellWaitMin">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" minimum="0" numberType="java.lang.Long" stepSize="1000" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="sellWaitMax">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" minimum="0" numberType="java.lang.Long" stepSize="1000" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="buyWaitMax">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" minimum="0" numberType="java.lang.Long" stepSize="1000" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="buyLimitMin">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0.0" minimum="-100.0" numberType="java.lang.Float" stepSize="1.0" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="buyLimitMax">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0.0" minimum="-100.0" numberType="java.lang.Float" stepSize="1.0" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="sellLimitMax">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0.0" minimum="-100.0" numberType="java.lang.Float" stepSize="1.0" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="sellLimitMin">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0.0" minimum="-100.0" numberType="java.lang.Float" stepSize="1.0" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="waitAfterBuyMin">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" minimum="0" numberType="java.lang.Integer" stepSize="1000" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="waitAfterSellMin">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" minimum="0" numberType="java.lang.Integer" stepSize="1000" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="waitAfterSellMax">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" minimum="0" numberType="java.lang.Integer" stepSize="1000" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="waitAfterBuyMax">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" minimum="0" numberType="java.lang.Integer" stepSize="1000" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="buyVolMin">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0.0" maximum="100.0" minimum="0.0" numberType="java.lang.Float" stepSize="1.0" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="buyVolMax">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0.0" maximum="100.0" minimum="0.0" numberType="java.lang.Float" stepSize="1.0" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="sellVolMax">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0.0" maximum="100.0" minimum="0.0" numberType="java.lang.Float" stepSize="1.0" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="sellVolMin">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0.0" maximum="100.0" minimum="0.0" numberType="java.lang.Float" stepSize="1.0" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="min:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="max:"/>
|
||||
<Property name="verticalAlignment" type="int" value="3"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel3">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="min:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel4">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="max:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel5">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="max:"/>
|
||||
<Property name="verticalAlignment" type="int" value="3"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel6">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="max:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel7">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="min:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel8">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="min:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel9">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Volume to buy (in %):"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel10">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Volume to sell (in %):"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel11">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Buy limit (in %):"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel12">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Sel limit (in %):"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel13">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="max:"/>
|
||||
<Property name="verticalAlignment" type="int" value="3"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel14">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="max:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel15">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Buy order wait (in ms):"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel16">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="min:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel17">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="min:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel18">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Sell order wait (in ms):"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel19">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="max:"/>
|
||||
<Property name="verticalAlignment" type="int" value="3"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel20">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="max:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel21">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="min:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel22">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="min:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel23">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Wait after buy (in ms):"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel24">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Wait after sell (in ms):"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
446
src/main/java/traders/RandomTraderGuiA.java
Normal file
446
src/main/java/traders/RandomTraderGuiA.java
Normal file
@ -0,0 +1,446 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 7u83 <7u83@mail.ru>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package traders;
|
||||
|
||||
import javax.swing.JDialog;
|
||||
import org.json.JSONObject;
|
||||
import sesim.AutoTraderGui;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author 7u83 <7u83@mail.ru>
|
||||
*/
|
||||
public class RandomTraderGuiA extends AutoTraderGui {
|
||||
|
||||
private RandomTraderA cfg;
|
||||
|
||||
/**
|
||||
* Creates new form RandomTraderConfigForm
|
||||
*/
|
||||
public RandomTraderGuiA(RandomTraderA cfg) {
|
||||
initComponents();
|
||||
this.cfg = cfg;
|
||||
|
||||
JDialog d;
|
||||
|
||||
this.buyVolMin.setValue(cfg.buy_volume[0]);
|
||||
this.buyVolMax.setValue(cfg.buy_volume[1]);
|
||||
this.sellVolMin.setValue(cfg.sell_volume[0]);
|
||||
this.sellVolMax.setValue(cfg.sell_volume[1]);
|
||||
this.buyLimitMin.setValue(cfg.buy_limit[0]);
|
||||
this.buyLimitMax.setValue(cfg.buy_limit[1]);
|
||||
this.sellLimitMin.setValue(cfg.sell_limit[0]);
|
||||
this.sellLimitMax.setValue(cfg.sell_limit[1]);
|
||||
|
||||
this.buyWaitMin.setValue(cfg.buy_wait[0]);
|
||||
this.buyWaitMax.setValue(cfg.buy_wait[1]);
|
||||
this.sellWaitMin.setValue(cfg.sell_wait[0]);
|
||||
this.sellWaitMax.setValue(cfg.sell_wait[1]);
|
||||
|
||||
this.waitAfterBuyMin.setValue(cfg.wait_after_buy[0]);
|
||||
this.waitAfterBuyMax.setValue(cfg.wait_after_buy[1]);
|
||||
|
||||
this.waitAfterSellMin.setValue(cfg.wait_after_sell[0]);
|
||||
this.waitAfterSellMax.setValue(cfg.wait_after_sell[1]);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save() {
|
||||
|
||||
cfg.buy_volume[0] = (Float) this.buyVolMin.getValue();
|
||||
cfg.buy_volume[1] = (Float) this.buyVolMax.getValue();
|
||||
cfg.sell_volume[0] = (Float) this.sellVolMin.getValue();
|
||||
cfg.sell_volume[1] = (Float) this.sellVolMax.getValue();
|
||||
cfg.buy_limit[0] = (Float) this.buyLimitMin.getValue();
|
||||
cfg.buy_limit[1] = (Float) this.buyLimitMax.getValue();
|
||||
cfg.sell_limit[0] = (Float) this.sellLimitMin.getValue();
|
||||
cfg.sell_limit[1] = (Float) this.sellLimitMax.getValue();
|
||||
cfg.buy_wait[0] = (Long) this.buyWaitMin.getValue();
|
||||
cfg.buy_wait[1] = (Long) this.buyWaitMax.getValue();
|
||||
cfg.sell_wait[0] = (Long) this.sellWaitMin.getValue();
|
||||
cfg.sell_wait[1] = (Long) this.sellWaitMax.getValue();
|
||||
|
||||
cfg.wait_after_buy[0] = (Long) this.waitAfterBuyMin.getValue();
|
||||
cfg.wait_after_buy[1] = (Long) this.waitAfterBuyMax.getValue();
|
||||
cfg.wait_after_sell[0] = (Long) this.waitAfterSellMin.getValue();
|
||||
cfg.wait_after_sell[1] = (Long) this.waitAfterSellMax.getValue();
|
||||
|
||||
|
||||
// cfg.buy_volume[0] = Float.parseFloat(this.buyVolMin.getText());
|
||||
// cfg.buy_volume[1] = Float.parseFloat(this.buyVolMax.getText());
|
||||
// cfg.sell_volume[0] = Float.parseFloat(this.sellVolMin.getText());
|
||||
// cfg.sell_volume[1] = Float.parseFloat(this.sellVolMax.getText());
|
||||
JSONObject j = cfg.getConfig();
|
||||
System.out.printf("JSON: %s\n", j.toString(3));
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called from within the constructor to initialize the form.
|
||||
* WARNING: Do NOT modify this code. The content of this method is always
|
||||
* regenerated by the Form Editor.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
|
||||
jTextField1 = new javax.swing.JTextField();
|
||||
buyWaitMin = new javax.swing.JSpinner();
|
||||
sellWaitMin = new javax.swing.JSpinner();
|
||||
sellWaitMax = new javax.swing.JSpinner();
|
||||
buyWaitMax = new javax.swing.JSpinner();
|
||||
buyLimitMin = new javax.swing.JSpinner();
|
||||
buyLimitMax = new javax.swing.JSpinner();
|
||||
sellLimitMax = new javax.swing.JSpinner();
|
||||
sellLimitMin = new javax.swing.JSpinner();
|
||||
waitAfterBuyMin = new javax.swing.JSpinner();
|
||||
waitAfterSellMin = new javax.swing.JSpinner();
|
||||
waitAfterSellMax = new javax.swing.JSpinner();
|
||||
waitAfterBuyMax = new javax.swing.JSpinner();
|
||||
buyVolMin = new javax.swing.JSpinner();
|
||||
buyVolMax = new javax.swing.JSpinner();
|
||||
sellVolMax = new javax.swing.JSpinner();
|
||||
sellVolMin = new javax.swing.JSpinner();
|
||||
jLabel1 = new javax.swing.JLabel();
|
||||
jLabel2 = new javax.swing.JLabel();
|
||||
jLabel3 = new javax.swing.JLabel();
|
||||
jLabel4 = new javax.swing.JLabel();
|
||||
jLabel5 = new javax.swing.JLabel();
|
||||
jLabel6 = new javax.swing.JLabel();
|
||||
jLabel7 = new javax.swing.JLabel();
|
||||
jLabel8 = new javax.swing.JLabel();
|
||||
jLabel9 = new javax.swing.JLabel();
|
||||
jLabel10 = new javax.swing.JLabel();
|
||||
jLabel11 = new javax.swing.JLabel();
|
||||
jLabel12 = new javax.swing.JLabel();
|
||||
jLabel13 = new javax.swing.JLabel();
|
||||
jLabel14 = new javax.swing.JLabel();
|
||||
jLabel15 = new javax.swing.JLabel();
|
||||
jLabel16 = new javax.swing.JLabel();
|
||||
jLabel17 = new javax.swing.JLabel();
|
||||
jLabel18 = new javax.swing.JLabel();
|
||||
jLabel19 = new javax.swing.JLabel();
|
||||
jLabel20 = new javax.swing.JLabel();
|
||||
jLabel21 = new javax.swing.JLabel();
|
||||
jLabel22 = new javax.swing.JLabel();
|
||||
jLabel23 = new javax.swing.JLabel();
|
||||
jLabel24 = new javax.swing.JLabel();
|
||||
|
||||
jTextField1.setText("jTextField1");
|
||||
|
||||
setBorder(null);
|
||||
|
||||
buyWaitMin.setModel(new javax.swing.SpinnerNumberModel(0L, 0L, null, 1000L));
|
||||
|
||||
sellWaitMin.setModel(new javax.swing.SpinnerNumberModel(0L, 0L, null, 1000L));
|
||||
|
||||
sellWaitMax.setModel(new javax.swing.SpinnerNumberModel(0L, 0L, null, 1000L));
|
||||
|
||||
buyWaitMax.setModel(new javax.swing.SpinnerNumberModel(0L, 0L, null, 1000L));
|
||||
|
||||
buyLimitMin.setModel(new javax.swing.SpinnerNumberModel(0.0f, -100.0f, null, 1.0f));
|
||||
|
||||
buyLimitMax.setModel(new javax.swing.SpinnerNumberModel(0.0f, -100.0f, null, 1.0f));
|
||||
|
||||
sellLimitMax.setModel(new javax.swing.SpinnerNumberModel(0.0f, -100.0f, null, 1.0f));
|
||||
|
||||
sellLimitMin.setModel(new javax.swing.SpinnerNumberModel(0.0f, -100.0f, null, 1.0f));
|
||||
|
||||
waitAfterBuyMin.setModel(new javax.swing.SpinnerNumberModel(0, 0, null, 1000));
|
||||
|
||||
waitAfterSellMin.setModel(new javax.swing.SpinnerNumberModel(0, 0, null, 1000));
|
||||
|
||||
waitAfterSellMax.setModel(new javax.swing.SpinnerNumberModel(0, 0, null, 1000));
|
||||
|
||||
waitAfterBuyMax.setModel(new javax.swing.SpinnerNumberModel(0, 0, null, 1000));
|
||||
|
||||
buyVolMin.setModel(new javax.swing.SpinnerNumberModel(Float.valueOf(0.0f), Float.valueOf(0.0f), Float.valueOf(100.0f), Float.valueOf(1.0f)));
|
||||
|
||||
buyVolMax.setModel(new javax.swing.SpinnerNumberModel(Float.valueOf(0.0f), Float.valueOf(0.0f), Float.valueOf(100.0f), Float.valueOf(1.0f)));
|
||||
|
||||
sellVolMax.setModel(new javax.swing.SpinnerNumberModel(Float.valueOf(0.0f), Float.valueOf(0.0f), Float.valueOf(100.0f), Float.valueOf(1.0f)));
|
||||
|
||||
sellVolMin.setModel(new javax.swing.SpinnerNumberModel(Float.valueOf(0.0f), Float.valueOf(0.0f), Float.valueOf(100.0f), Float.valueOf(1.0f)));
|
||||
|
||||
jLabel1.setText("min:");
|
||||
|
||||
jLabel2.setText("max:");
|
||||
jLabel2.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
|
||||
|
||||
jLabel3.setText("min:");
|
||||
|
||||
jLabel4.setText("max:");
|
||||
|
||||
jLabel5.setText("max:");
|
||||
jLabel5.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
|
||||
|
||||
jLabel6.setText("max:");
|
||||
|
||||
jLabel7.setText("min:");
|
||||
|
||||
jLabel8.setText("min:");
|
||||
|
||||
jLabel9.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel9.setText("Volume to buy (in %):");
|
||||
|
||||
jLabel10.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel10.setText("Volume to sell (in %):");
|
||||
|
||||
jLabel11.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel11.setText("Buy limit (in %):");
|
||||
|
||||
jLabel12.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel12.setText("Sel limit (in %):");
|
||||
|
||||
jLabel13.setText("max:");
|
||||
jLabel13.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
|
||||
|
||||
jLabel14.setText("max:");
|
||||
|
||||
jLabel15.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel15.setText("Buy order wait (in ms):");
|
||||
|
||||
jLabel16.setText("min:");
|
||||
|
||||
jLabel17.setText("min:");
|
||||
|
||||
jLabel18.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel18.setText("Sell order wait (in ms):");
|
||||
|
||||
jLabel19.setText("max:");
|
||||
jLabel19.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
|
||||
|
||||
jLabel20.setText("max:");
|
||||
|
||||
jLabel21.setText("min:");
|
||||
|
||||
jLabel22.setText("min:");
|
||||
|
||||
jLabel23.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel23.setText("Wait after buy (in ms):");
|
||||
|
||||
jLabel24.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel24.setText("Wait after sell (in ms):");
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||
this.setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addComponent(jLabel24, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(jLabel22))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addComponent(jLabel23, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(jLabel21)))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(waitAfterSellMin, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(waitAfterBuyMin, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(18, 18, 18)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(jLabel19)
|
||||
.addComponent(jLabel20))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(waitAfterSellMax, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(waitAfterBuyMax, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(jLabel1))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addComponent(jLabel12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(jLabel8))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE, 175, Short.MAX_VALUE)
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(jLabel3))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addComponent(jLabel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(jLabel7))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addComponent(jLabel18, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(jLabel17))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addComponent(jLabel15, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(jLabel16)))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
|
||||
.addComponent(sellVolMin, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(buyVolMin, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(sellLimitMin, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(buyLimitMin, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(buyWaitMin, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(sellWaitMin, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(18, 18, 18)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(jLabel13)
|
||||
.addComponent(jLabel14))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(sellWaitMax, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(buyWaitMax, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(jLabel5)
|
||||
.addComponent(jLabel6))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(sellLimitMax, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(buyLimitMax, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(jLabel2)
|
||||
.addComponent(jLabel4))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(sellVolMax, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(buyVolMax, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE))))))
|
||||
.addGap(43, 43, 43))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(40, 40, 40)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(buyVolMin, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(buyVolMax, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel1)
|
||||
.addComponent(jLabel2)
|
||||
.addComponent(jLabel9))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(sellVolMin, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(sellVolMax, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel3)
|
||||
.addComponent(jLabel4)
|
||||
.addComponent(jLabel10))
|
||||
.addGap(18, 18, 18)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(buyLimitMin, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(buyLimitMax, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel5)
|
||||
.addComponent(jLabel7)
|
||||
.addComponent(jLabel11))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(sellLimitMin, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(sellLimitMax, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel6)
|
||||
.addComponent(jLabel8)
|
||||
.addComponent(jLabel12))
|
||||
.addGap(35, 35, 35)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(buyWaitMax, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel13)
|
||||
.addComponent(jLabel16)
|
||||
.addComponent(jLabel15)
|
||||
.addComponent(buyWaitMin, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(sellWaitMin, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(sellWaitMax, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel14)
|
||||
.addComponent(jLabel17)
|
||||
.addComponent(jLabel18))
|
||||
.addGap(18, 18, 18)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(waitAfterBuyMin, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(waitAfterBuyMax, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel19)
|
||||
.addComponent(jLabel21)
|
||||
.addComponent(jLabel23))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(waitAfterSellMin, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(waitAfterSellMax, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel20)
|
||||
.addComponent(jLabel22)
|
||||
.addComponent(jLabel24))
|
||||
.addContainerGap(37, Short.MAX_VALUE))
|
||||
);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JSpinner buyLimitMax;
|
||||
private javax.swing.JSpinner buyLimitMin;
|
||||
private javax.swing.JSpinner buyVolMax;
|
||||
private javax.swing.JSpinner buyVolMin;
|
||||
private javax.swing.JSpinner buyWaitMax;
|
||||
private javax.swing.JSpinner buyWaitMin;
|
||||
private javax.swing.JLabel jLabel1;
|
||||
private javax.swing.JLabel jLabel10;
|
||||
private javax.swing.JLabel jLabel11;
|
||||
private javax.swing.JLabel jLabel12;
|
||||
private javax.swing.JLabel jLabel13;
|
||||
private javax.swing.JLabel jLabel14;
|
||||
private javax.swing.JLabel jLabel15;
|
||||
private javax.swing.JLabel jLabel16;
|
||||
private javax.swing.JLabel jLabel17;
|
||||
private javax.swing.JLabel jLabel18;
|
||||
private javax.swing.JLabel jLabel19;
|
||||
private javax.swing.JLabel jLabel2;
|
||||
private javax.swing.JLabel jLabel20;
|
||||
private javax.swing.JLabel jLabel21;
|
||||
private javax.swing.JLabel jLabel22;
|
||||
private javax.swing.JLabel jLabel23;
|
||||
private javax.swing.JLabel jLabel24;
|
||||
private javax.swing.JLabel jLabel3;
|
||||
private javax.swing.JLabel jLabel4;
|
||||
private javax.swing.JLabel jLabel5;
|
||||
private javax.swing.JLabel jLabel6;
|
||||
private javax.swing.JLabel jLabel7;
|
||||
private javax.swing.JLabel jLabel8;
|
||||
private javax.swing.JLabel jLabel9;
|
||||
private javax.swing.JTextField jTextField1;
|
||||
private javax.swing.JSpinner sellLimitMax;
|
||||
private javax.swing.JSpinner sellLimitMin;
|
||||
private javax.swing.JSpinner sellVolMax;
|
||||
private javax.swing.JSpinner sellVolMin;
|
||||
private javax.swing.JSpinner sellWaitMax;
|
||||
private javax.swing.JSpinner sellWaitMin;
|
||||
private javax.swing.JSpinner waitAfterBuyMax;
|
||||
private javax.swing.JSpinner waitAfterBuyMin;
|
||||
private javax.swing.JSpinner waitAfterSellMax;
|
||||
private javax.swing.JSpinner waitAfterSellMin;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
@ -1,76 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017, tobias
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package traders;
|
||||
|
||||
import javax.swing.JPanel;
|
||||
import org.json.JSONObject;
|
||||
import sesim.AutoTrader;
|
||||
import sesim.AutoTraderConfig;
|
||||
import sesim.AutoTraderGui;
|
||||
import sesim.Exchange;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tobias
|
||||
*/
|
||||
public class SuperTraderConfig implements AutoTraderConfig{
|
||||
|
||||
@Override
|
||||
public AutoTrader createTrader(Exchange se, JSONObject cfg, long id, String name,double money, double shares) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return "SuperTrader";
|
||||
}
|
||||
|
||||
|
||||
public SuperTraderConfig(){
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public AutoTraderGui getGui() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getConfig() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putConfig(JSONObject cfg) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getDevelStatus() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user