diff --git a/endless.php b/endless.php new file mode 100644 index 0000000..68acd0e --- /dev/null +++ b/endless.php @@ -0,0 +1,15 @@ + "world" +); + +for ($i=0; $i - - - + @@ -29,36 +27,13 @@ - - - - + - - - - - - - - - - - - - - - - - - - - @@ -68,12 +43,12 @@ - + - + diff --git a/src/main/java/chart/FullChart.java b/src/main/java/chart/FullChart.java index b583bc9..3655b4d 100644 --- a/src/main/java/chart/FullChart.java +++ b/src/main/java/chart/FullChart.java @@ -47,32 +47,18 @@ public class FullChart extends javax.swing.JPanel { // //GEN-BEGIN:initComponents private void initComponents() { - legend1 = new chart.Legend(); jScrollPane1 = new javax.swing.JScrollPane(); chart1 = new chart.Chart(); - legend1.setBackground(new java.awt.Color(255, 204, 204)); - - javax.swing.GroupLayout legend1Layout = new javax.swing.GroupLayout(legend1); - legend1.setLayout(legend1Layout); - legend1Layout.setHorizontalGroup( - legend1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 75, Short.MAX_VALUE) - ); - legend1Layout.setVerticalGroup( - legend1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 0, Short.MAX_VALUE) - ); - javax.swing.GroupLayout chart1Layout = new javax.swing.GroupLayout(chart1); chart1.setLayout(chart1Layout); chart1Layout.setHorizontalGroup( chart1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 737, Short.MAX_VALUE) + .addGap(0, 3480, Short.MAX_VALUE) ); chart1Layout.setVerticalGroup( chart1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 295, Short.MAX_VALUE) + .addGap(0, 280, Short.MAX_VALUE) ); jScrollPane1.setViewportView(chart1); @@ -83,18 +69,14 @@ public class FullChart extends javax.swing.JPanel { layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() - .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 763, Short.MAX_VALUE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(legend1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 844, Short.MAX_VALUE) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(legend1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 321, Short.MAX_VALUE)) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 321, Short.MAX_VALUE) .addContainerGap()) ); }// //GEN-END:initComponents @@ -103,6 +85,5 @@ public class FullChart extends javax.swing.JPanel { // Variables declaration - do not modify//GEN-BEGIN:variables private chart.Chart chart1; private javax.swing.JScrollPane jScrollPane1; - private chart.Legend legend1; // End of variables declaration//GEN-END:variables } diff --git a/src/main/java/chart/OHLCData.java b/src/main/java/chart/OHLCData.java index 4a68415..3cfca00 100644 --- a/src/main/java/chart/OHLCData.java +++ b/src/main/java/chart/OHLCData.java @@ -36,7 +36,7 @@ public class OHLCData { //extends ArrayList { float max=0; float min=0; - int ras=60000; + int ras=60000/10; long time_start; diff --git a/src/main/java/gui/MainWin.java b/src/main/java/gui/MainWin.java index fd7f52c..f8ec534 100644 --- a/src/main/java/gui/MainWin.java +++ b/src/main/java/gui/MainWin.java @@ -207,13 +207,13 @@ public class MainWin extends javax.swing.JFrame { RandomTraderConfig rcfg1 = new RandomTraderConfig(); AutoTrader rt1 = rcfg1.createTrader(se, 1000000, 0); rt1.start(); - AutoTrader rt2 = rcfg1.createTrader(se, 1, 100); - rt2.start(); + //AutoTrader rt2 = rcfg1.createTrader(se, 1, 100); + //rt2.start(); RandomTraderConfig cfg = new RandomTraderConfig(); - for (int i=0; i<10000; i++){ - AutoTrader randt = cfg.createTrader(se, 1, 100); + for (int i=0; i<100; i++){ + AutoTrader randt = cfg.createTrader(se, 100, 100); randt.start(); } diff --git a/src/main/java/traders/RandomTrader.java b/src/main/java/traders/RandomTrader.java index 7420646..8d4d57b 100644 --- a/src/main/java/traders/RandomTrader.java +++ b/src/main/java/traders/RandomTrader.java @@ -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); diff --git a/src/main/java/traders/RandomTraderConfig.java b/src/main/java/traders/RandomTraderConfig.java index 59e99fe..adeb392 100644 --- a/src/main/java/traders/RandomTraderConfig.java +++ b/src/main/java/traders/RandomTraderConfig.java @@ -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};