update failtodeliver component
This commit is contained in:
parent
f3d050d366
commit
aaf2d14868
@ -16,13 +16,12 @@
|
|||||||
let isLoaded = false;
|
let isLoaded = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let rawData = [];
|
let rawData = [];
|
||||||
let optionsData;
|
let optionsData;
|
||||||
let avgFailToDeliver;
|
let avgFailToDeliver;
|
||||||
let lowestPrice;
|
let lowestPrice;
|
||||||
let highestPrice;
|
let highestPrice;
|
||||||
|
let weightedFTD;
|
||||||
|
|
||||||
|
|
||||||
function findLowestAndHighestPrice(data, lastDateStr) {
|
function findLowestAndHighestPrice(data, lastDateStr) {
|
||||||
@ -212,7 +211,10 @@ function findLowestAndHighestPrice(data, lastDateStr) {
|
|||||||
];
|
];
|
||||||
Promise.all(asyncFunctions)
|
Promise.all(asyncFunctions)
|
||||||
.then((results) => {
|
.then((results) => {
|
||||||
optionsData = getPlotOptions()
|
if(rawData?.length !== 0) {
|
||||||
|
weightedFTD = ((rawData?.slice(-1)?.at(0)?.failToDeliver/data?.getStockQuote?.avgVolume) * 100)?.toFixed(2);
|
||||||
|
optionsData = getPlotOptions()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error('An error occurred:', error);
|
console.error('An error occurred:', error);
|
||||||
@ -222,19 +224,7 @@ function findLowestAndHighestPrice(data, lastDateStr) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let charNumber = 20;
|
let charNumber = $screenWidth < 640 ? 20 : 40;
|
||||||
|
|
||||||
$: {
|
|
||||||
if($screenWidth < 640)
|
|
||||||
{
|
|
||||||
charNumber = 20;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
charNumber =40;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -330,6 +320,12 @@ function findLowestAndHighestPrice(data, lastDateStr) {
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="w-full flex flex-col items-start mt-3">
|
||||||
|
<div class="text-white text-[1rem] mt-2 mb-2 w-full">
|
||||||
|
Using the latest FTD shares data, we calculate the monthly average volume ratio to determine that less than
|
||||||
|
<strong>{weightedFTD < 0.01 ? '< 0.01' : weightedFTD}%</strong> of shares failed to deliver.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user