Skip to content

Commit

Permalink
0.2.0.4 - performance (history loaded onclick), trade status
Browse files Browse the repository at this point in the history
visualisation and other gui inprovements
  • Loading branch information
marek committed May 10, 2013
1 parent 10a6ed9 commit cb8b02f
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 47 deletions.
5 changes: 3 additions & 2 deletions chart.html
Expand Up @@ -7,6 +7,7 @@
<link rel="stylesheet" type="text/css" href="css/jquery.jqChart.css" />
<link rel="stylesheet" type="text/css" href="css/jquery.jqRangeSlider.css" />
<link rel="stylesheet" type="text/css" href="css/jquery-ui-1.8.20.css" />
<link rel="stylesheet" type="text/css" href="css/table.css" />
<script src="js/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="js/jquery.jqChart.min.js" type="text/javascript"></script>
<script src="js/jquery.jqRangeSlider.min.js" type="text/javascript"></script>
Expand All @@ -20,8 +21,8 @@
</div>
</div>
<div>
<h3>History:</h3>
<table id="tab" cellpadding="1" cellspacing="0" border="1">
<h3><a href="#" id="hrefHistory">History:</a></h3>
<table id="tab" cellpadding="1" cellspacing="0" border="1" style="display:none">
<tr><th>Index<th>Date<th>Type<th>Value<th>Balance<th>Info
</table>
</div>
Expand Down
40 changes: 40 additions & 0 deletions css/table.css
@@ -0,0 +1,40 @@
body {margin: 5px; padding: 0px}
table {
border-width: 1px;
border-spacing: 2px;
border-style: outset;
border-color: gray;
border-collapse:collapse;
background-color: white;
font-size: 14px;
width: 100%;
}
th {
white-space: nowrap;
text-align: center;
background-color: black;
color: white;
}
td {
white-space: nowrap;
text-align: right;
width: 50px;
padding-right: 3px;
}
td.c {
text-align: center;
background-color: #d0d0d0;
color: blue;
}
td.d {
padding:4px 0 ;
text-align: center;
background-color: #d0d0d0;
color: black;
font-size:12px;
}
td.err {
text-align: center;
background-color: #e0e0ff;
color: red;
}
Binary file added img/options.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions js/chart.js
Expand Up @@ -166,6 +166,8 @@ function processTradeData(emaLong, h1, emaShort, tim) {
if (rdo.result == "success") {
var recNum = parseInt(rdo.return.records);
var tab = document.getElementById("tab");
tab.style.display="inline";
while (tab.rows.length>1) tab.deleteRow(1)
for (var i=0; i<recNum; i++) {
var res = rdo.return.result[i];//
//.Index;
Expand Down Expand Up @@ -197,6 +199,8 @@ function processTradeData(emaLong, h1, emaShort, tim) {

$(document).ready(function () {

showTrades();
showTradesHist();
showTrades();
var hrefHist = document.getElementById("hrefHistory");
hrefHist.onclick = showTradesHist;
//showTradesHist();
});
2 changes: 1 addition & 1 deletion manifest.json
Expand Up @@ -14,5 +14,5 @@
"name": "Gox Trading Bot",
"options_page": "options.html",
"permissions": [ "https://mtgox.com/", "https://data.mtgox.com/", "https://vircurex.com/" ],
"version": "0.2.0.3"
"version": "0.2.0.4"
}
50 changes: 8 additions & 42 deletions popup.html
@@ -1,63 +1,29 @@
<html>
<head>
<style>
body {margin: 5px; padding: 0px}
div {
overflow:auto;
width:315px;
max-height:500px;
}
table {
border-width: 1px;
border-spacing: 2px;
border-style: outset;
border-color: gray;
border-collapse:collapse;
background-color: white;
font-size: 14px;
width: 100%;
}
th {
white-space: nowrap;
text-align: center;
background-color: black;
color: white;
}
td {
white-space: nowrap;
text-align: right;
width: 50px;
padding-right: 3px;
}
td.c {
text-align: center;
background-color: #d0d0d0;
color: blue;
}
td.d {
padding:4px 0 ;
text-align: center;
background-color: #d0d0d0;
color: black;
font-size:12px;
}
td.err {
text-align: center;
background-color: #e0e0ff;
color: red;
}
</style>
<link rel="stylesheet" type="text/css" href="css/table.css" />
</head>
<body>
<div>
<table id="tab" cellpadding="1" cellspacing="0" border="1">
<tr id="settings">
<th class="d" colspan="5">
<span id="tradingStatus"></span>

</th>
</tr>
<tr id="settings">
<th class="d" colspan="5"/>
<th class="d">
<a href="options.html" id="hrOptions"><img src="img/options.png" alt="See options"/></a>
</th>
<th class="d" colspan="4">
<span id="tradingStatus"></span>
</th>
</tr>


Expand Down
3 changes: 3 additions & 0 deletions popup.js
Expand Up @@ -14,6 +14,9 @@ function refreshtable() {
var tab = document.getElementById("tab")
document.getElementById("emal").innerHTML=bp.EmaLongPar
document.getElementById("emas").innerHTML=bp.EmaShortPar

document.getElementById("tradingStatus").innerHTML=(bp.tradingEnabled==1?"<span style=\"color:#008000\"><b>Trading is enabled</b></span><br>":"<span style=\"color:#A00000\"><b>Trading is disabled</b></span><br>");

while (tab.rows.length>5) tab.deleteRow(1)

if (bp.updateinprogress) { // && bp.H1.length>bp.LogLines) {
Expand Down

0 comments on commit cb8b02f

Please sign in to comment.