- Style enhancements
- Removal of single order items - Add index to table creation script
This commit is contained in:
@@ -10,6 +10,11 @@ body {
|
|||||||
}
|
}
|
||||||
.nav-tabs>li { float: none; }
|
.nav-tabs>li { float: none; }
|
||||||
|
|
||||||
|
#listOrderItems {
|
||||||
|
padding-left: 0;
|
||||||
|
list-style-type: none;
|
||||||
|
}
|
||||||
|
|
||||||
#lbSymbol {
|
#lbSymbol {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
@@ -46,15 +51,15 @@ body {
|
|||||||
top:250;
|
top:250;
|
||||||
width:300px;
|
width:300px;
|
||||||
height:100%;
|
height:100%;
|
||||||
|
padding-left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#frmOptionChainMain {
|
#frmOptionChainMain {
|
||||||
background-color: white;
|
background-color: #EEEEFF;
|
||||||
position:absolute;
|
position:absolute;
|
||||||
left:300;
|
left:300;
|
||||||
top:100px;
|
top:100px;
|
||||||
width:800px;
|
width:800px;
|
||||||
height: 100%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.ralign { text-align:right; }
|
.ralign { text-align:right; }
|
||||||
@@ -64,4 +69,17 @@ body {
|
|||||||
.itm { background-color:#ecffb3; }
|
.itm { background-color:#ecffb3; }
|
||||||
.otm { background-color:#e0ebeb; }
|
.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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,10 +4,6 @@ var optionChainContext={};
|
|||||||
|
|
||||||
$(document).ready(_=>{
|
$(document).ready(_=>{
|
||||||
dta={};
|
dta={};
|
||||||
//allCombinations=$.get("/getCombinations",
|
|
||||||
// data=>{allCombinations=data;},
|
|
||||||
// "json");
|
|
||||||
// displayOptionChain();
|
|
||||||
createOrderFrame();
|
createOrderFrame();
|
||||||
createMasterFilterFrame();
|
createMasterFilterFrame();
|
||||||
let selectDataFirst=_=>{
|
let selectDataFirst=_=>{
|
||||||
@@ -42,11 +38,19 @@ let addToOrder=(openType,optionData)=>{
|
|||||||
console.log("AddToOrder",openType,optionData);
|
console.log("AddToOrder",openType,optionData);
|
||||||
|
|
||||||
let price=(openType.substr(0,1)==="b")?optionData.ask:optionData.bid;
|
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();
|
showCostAmount();
|
||||||
$("#listOrderItems").append(`<li><a onclick='alert("TODO - not yet implemented.");'>[X]</a> ${openType} | ${optionData.symbol} | ${price*100}</li>`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let showCostAmount=_=>{
|
let showCostAmount=_=>{
|
||||||
@@ -83,6 +87,8 @@ let getCallArtifact=(callData,allColumns)=>{
|
|||||||
bidFrm=Number(callData.bid).toLocaleString('en',{minimumFractionDigits: 2, maximumFractionDigits: 2});
|
bidFrm=Number(callData.bid).toLocaleString('en',{minimumFractionDigits: 2, maximumFractionDigits: 2});
|
||||||
askFrm=Number(callData.ask).toLocaleString('en',{minimumFractionDigits: 2, maximumFractionDigits: 2});
|
askFrm=Number(callData.ask).toLocaleString('en',{minimumFractionDigits: 2, maximumFractionDigits: 2});
|
||||||
|
|
||||||
|
classes += " priceClick";
|
||||||
|
|
||||||
artifact+=`
|
artifact+=`
|
||||||
<td class="${classes} ralign" onclick="addToOrder('sell','${strCallJSON}')"><a href="#" title="Sell">${bidFrm}</a></td>
|
<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>
|
<td class="${classes} ralign" onclick="addToOrder('buy','${strCallJSON}')"><a href="#" title="Buy">${askFrm}</a></td>
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
CREATE TABLE IF NOT EXISTS "OptionQuotes"( "TimeStamp"DateTime DEFAULT CURRENT_TIMESTAMP,
|
CREATE TABLE IF NOT EXISTS "OptionQuotes"( "TimeStamp"DateTime DEFAULT CURRENT_TIMESTAMP,
|
||||||
"Symbol" Text,
|
"Symbol" Text,
|
||||||
"Data" Text);
|
"Data" Text);
|
||||||
|
|
||||||
|
CREATE INDEX smbDaTi on OptionQuotes (Symbol,timestamp);
|
||||||
|
|||||||
Reference in New Issue
Block a user