- Style enhancements

- Removal of single order items
- Add index to table creation script
This commit is contained in:
Joe Tretter
2020-04-24 17:18:55 -05:00
parent 69d8d56e9a
commit 5321e2430d
3 changed files with 35 additions and 9 deletions

View File

@@ -10,6 +10,11 @@ body {
}
.nav-tabs>li { float: none; }
#listOrderItems {
padding-left: 0;
list-style-type: none;
}
#lbSymbol {
position: absolute;
top: 0;
@@ -46,15 +51,15 @@ body {
top:250;
width:300px;
height:100%;
padding-left: 0;
}
#frmOptionChainMain {
background-color: white;
background-color: #EEEEFF;
position:absolute;
left:300;
top:100px;
width:800px;
height: 100%;
}
.ralign { text-align:right; }
@@ -64,4 +69,17 @@ body {
.itm { background-color:#ecffb3; }
.otm { background-color:#e0ebeb; }
.danger {
background-color:#FF0000;
color:#0000FF;
cursor: no-drop;
}
.priceClick {
cursor: copy;
}
.table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th {
padding:0px;
}

View File

@@ -4,10 +4,6 @@ var optionChainContext={};
$(document).ready(_=>{
dta={};
//allCombinations=$.get("/getCombinations",
// data=>{allCombinations=data;},
// "json");
// displayOptionChain();
createOrderFrame();
createMasterFilterFrame();
let selectDataFirst=_=>{
@@ -42,11 +38,19 @@ let addToOrder=(openType,optionData)=>{
console.log("AddToOrder",openType,optionData);
let price=(openType.substr(0,1)==="b")?optionData.ask:optionData.bid;
price=Number(price*100).toLocaleString('en',{minimumFractionDigits: 2, maximumFractionDigits: 2})
price=price*100;
costAmount+=(price*100) * ((openType.substr(0,1)==="b")?-1:1);
let priceEffect=price * ((openType.substr(0,1)==="b")?-1:1);
costAmount+=priceEffect;
showCostAmount();
$("#listOrderItems").append(`<li><a class='danger' onclick='removeFromOrder(this,${priceEffect});'>[X]</a> ${openType} | ${optionData.symbol} | ${price.toLocaleString('en',{minimumFractionDigits: 2, maximumFractionDigits: 2})}</li>`);
}
let removeFromOrder=(ele,priceEffect)=>{
costAmount-=priceEffect;
let li=ele.parentElement;
li.parentElement.removeChild(li);
showCostAmount();
$("#listOrderItems").append(`<li><a onclick='alert("TODO - not yet implemented.");'>[X]</a> ${openType} | ${optionData.symbol} | ${price*100}</li>`);
}
let showCostAmount=_=>{
@@ -83,6 +87,8 @@ let getCallArtifact=(callData,allColumns)=>{
bidFrm=Number(callData.bid).toLocaleString('en',{minimumFractionDigits: 2, maximumFractionDigits: 2});
askFrm=Number(callData.ask).toLocaleString('en',{minimumFractionDigits: 2, maximumFractionDigits: 2});
classes += " priceClick";
artifact+=`
<td class="${classes} ralign" onclick="addToOrder('sell','${strCallJSON}')"><a href="#" title="Sell">${bidFrm}</a></td>
<td class="${classes} ralign" onclick="addToOrder('buy','${strCallJSON}')"><a href="#" title="Buy">${askFrm}</a></td>

View File

@@ -1,3 +1,5 @@
CREATE TABLE IF NOT EXISTS "OptionQuotes"( "TimeStamp"DateTime DEFAULT CURRENT_TIMESTAMP,
"Symbol" Text,
"Data" Text);
CREATE INDEX smbDaTi on OptionQuotes (Symbol,timestamp);