|
|
|
@ -10,7 +10,17 @@ import {
|
|
|
|
|
Title,
|
|
|
|
|
} from "chart.js";
|
|
|
|
|
import { Scatter } from "react-chartjs-2";
|
|
|
|
|
// import './style.css';
|
|
|
|
|
import {
|
|
|
|
|
Container,
|
|
|
|
|
Grid,
|
|
|
|
|
Typography,
|
|
|
|
|
TextField,
|
|
|
|
|
Select,
|
|
|
|
|
MenuItem,
|
|
|
|
|
InputLabel,
|
|
|
|
|
FormControl,
|
|
|
|
|
Paper,
|
|
|
|
|
} from "@mui/material";
|
|
|
|
|
|
|
|
|
|
ChartJS.register(LinearScale, CategoryScale, PointElement, Tooltip, Title);
|
|
|
|
|
|
|
|
|
@ -188,122 +198,109 @@ export function HistoricalCalendarPrices() {
|
|
|
|
|
useEffect(handleInit, []);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
/* container for centering: */
|
|
|
|
|
<div class="flex flex-row justify-center">
|
|
|
|
|
<div class="flex flex-col justify-start gap-4">
|
|
|
|
|
{/* inputs form container: */}
|
|
|
|
|
<div class="flex flex-col justify-start gap-1 divide-y">
|
|
|
|
|
<div class="flex flex-row w-160 gap-3">
|
|
|
|
|
<div class="text-right w-1/3">
|
|
|
|
|
<label>Available Underlyings</label>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="my-auto w-2/3">
|
|
|
|
|
{availableUnderlyings.value.length === 0 ? (
|
|
|
|
|
"Loading..."
|
|
|
|
|
) : (
|
|
|
|
|
<select
|
|
|
|
|
<Container maxWidth="lg">
|
|
|
|
|
<Grid container spacing={4}>
|
|
|
|
|
<Grid item xs={12}>
|
|
|
|
|
<Typography variant="h4" gutterBottom>
|
|
|
|
|
Historical Calendar Prices
|
|
|
|
|
</Typography>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={12} md={6}>
|
|
|
|
|
<Paper elevation={3} sx={{ p: 3 }}>
|
|
|
|
|
<Grid container spacing={2}>
|
|
|
|
|
<Grid item xs={12}>
|
|
|
|
|
<FormControl fullWidth>
|
|
|
|
|
<InputLabel>Available Underlyings</InputLabel>
|
|
|
|
|
<Select
|
|
|
|
|
value={chosenUnderlying.value || ""}
|
|
|
|
|
onChange={handleUnderlyingChange}
|
|
|
|
|
class="border border-gray-300 focus:border-blue-400"
|
|
|
|
|
label="Available Underlyings"
|
|
|
|
|
>
|
|
|
|
|
{availableUnderlyings.value.map((availableUnderlying) => (
|
|
|
|
|
<option value={availableUnderlying}>
|
|
|
|
|
{availableUnderlying}
|
|
|
|
|
</option>
|
|
|
|
|
{availableUnderlyings.value.map((underlying) => (
|
|
|
|
|
<MenuItem key={underlying} value={underlying}>
|
|
|
|
|
{underlying}
|
|
|
|
|
</MenuItem>
|
|
|
|
|
))}
|
|
|
|
|
</select>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex flex-row w-160 gap-3">
|
|
|
|
|
<div class="text-right w-1/3">
|
|
|
|
|
<label>Now-to-Front-Month "Days to Expiration"</label>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="my-auto w-2/3">
|
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
onBlur={handleDaysToFrontExpirationChange}
|
|
|
|
|
</Select>
|
|
|
|
|
</FormControl>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={12}>
|
|
|
|
|
<TextField
|
|
|
|
|
fullWidth
|
|
|
|
|
label="Now-to-Front-Month Days to Expiration"
|
|
|
|
|
type="number"
|
|
|
|
|
value={chosenDaysToFrontExpiration.value}
|
|
|
|
|
class="border border-gray-300 focus:border-blue-400"
|
|
|
|
|
onChange={handleDaysToFrontExpirationChange}
|
|
|
|
|
InputProps={{ endAdornment: "Days" }}
|
|
|
|
|
/>
|
|
|
|
|
Days
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex flex-row w-160 gap-3">
|
|
|
|
|
<div class="text-right w-1/3">
|
|
|
|
|
<label>Front-to-Back-Month "Days to Expiration" Difference</label>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="my-auto w-2/3">
|
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
onBlur={handleDaysBetweenFrontAndBackExpirationChange}
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={12}>
|
|
|
|
|
<TextField
|
|
|
|
|
fullWidth
|
|
|
|
|
label="Front-to-Back-Month Days to Expiration Difference"
|
|
|
|
|
type="number"
|
|
|
|
|
value={chosenDaysBetweenFrontAndBackExpiration.value}
|
|
|
|
|
class="border border-gray-300 focus:border-blue-400"
|
|
|
|
|
onChange={handleDaysBetweenFrontAndBackExpirationChange}
|
|
|
|
|
InputProps={{ endAdornment: "Days Difference" }}
|
|
|
|
|
/>
|
|
|
|
|
Days Difference
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex flex-row w-160 gap-3">
|
|
|
|
|
<div class="text-right w-1/3">
|
|
|
|
|
<label>"Strike Percentage From Underlying Price" Range</label>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="my-auto w-2/3">
|
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
onBlur={handleStrikePercentageFromUnderlyingPriceChange}
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={6}>
|
|
|
|
|
<TextField
|
|
|
|
|
fullWidth
|
|
|
|
|
label="Strike % From Underlying Price"
|
|
|
|
|
type="number"
|
|
|
|
|
value={chosenStrikePercentageFromUnderlyingPrice.value}
|
|
|
|
|
class="border border-gray-300 focus:border-blue-400"
|
|
|
|
|
onChange={handleStrikePercentageFromUnderlyingPriceChange}
|
|
|
|
|
InputProps={{ endAdornment: "%" }}
|
|
|
|
|
/>
|
|
|
|
|
% +/-
|
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
onBlur={handleStrikePercentageFromUnderlyingPriceRadiusChange}
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={6}>
|
|
|
|
|
<TextField
|
|
|
|
|
fullWidth
|
|
|
|
|
label="Strike % Radius"
|
|
|
|
|
type="number"
|
|
|
|
|
value={chosenStrikePercentageFromUnderlyingPriceRadius.value}
|
|
|
|
|
class="border border-gray-300 focus:border-blue-400"
|
|
|
|
|
onChange={handleStrikePercentageFromUnderlyingPriceRadiusChange}
|
|
|
|
|
InputProps={{ endAdornment: "%" }}
|
|
|
|
|
/>
|
|
|
|
|
% from ATM
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex flex-row w-160 gap-3">
|
|
|
|
|
<div class="text-right w-1/3">
|
|
|
|
|
<label>Exit-to-Front-Month "Days to Expiration"</label>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="my-auto w-2/3">
|
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
onBlur={handleExitToFrontExpirationChange}
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={12}>
|
|
|
|
|
<TextField
|
|
|
|
|
fullWidth
|
|
|
|
|
label="Exit-to-Front-Month Days to Expiration"
|
|
|
|
|
type="number"
|
|
|
|
|
value={chosenExitToFrontExpiration.value}
|
|
|
|
|
class="border border-gray-300 focus:border-blue-400"
|
|
|
|
|
onChange={handleExitToFrontExpirationChange}
|
|
|
|
|
InputProps={{ endAdornment: "Days" }}
|
|
|
|
|
/>
|
|
|
|
|
Days
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex flex-row w-160 gap-3">
|
|
|
|
|
<div class="text-right w-1/3">
|
|
|
|
|
<label>Lookback Period</label>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="my-auto w-2/3">
|
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
onBlur={handleLookbackPeriodStartChange}
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={6}>
|
|
|
|
|
<TextField
|
|
|
|
|
fullWidth
|
|
|
|
|
label="Lookback Period Start"
|
|
|
|
|
type="date"
|
|
|
|
|
value={chosenLookbackPeriodStart.value}
|
|
|
|
|
class="border border-gray-300 focus:border-blue-400"
|
|
|
|
|
onChange={(e) => handleLookbackPeriodStartChange({ target: { value: e.target.value } })}
|
|
|
|
|
InputLabelProps={{ shrink: true }}
|
|
|
|
|
/>
|
|
|
|
|
-
|
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
onBlur={handleLookbackPeriodEndChange}
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={6}>
|
|
|
|
|
<TextField
|
|
|
|
|
fullWidth
|
|
|
|
|
label="Lookback Period End"
|
|
|
|
|
type="date"
|
|
|
|
|
value={chosenLookbackPeriodEnd.value}
|
|
|
|
|
class="border border-gray-300 focus:border-blue-400"
|
|
|
|
|
onChange={(e) => handleLookbackPeriodEndChange({ target: { value: e.target.value } })}
|
|
|
|
|
InputLabelProps={{ shrink: true }}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
{/* charts container: */}
|
|
|
|
|
<div className="flex flex-col justify-start gap-3">
|
|
|
|
|
<div className="min-h-96">
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Paper>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={12} md={6}>
|
|
|
|
|
<Paper elevation={3} sx={{ p: 3, height: '100%' }}>
|
|
|
|
|
{chosenUnderlying.value !== null &&
|
|
|
|
|
historicalStockQuoteChartData.value.length > 0 ? (
|
|
|
|
|
<div className="h-full">
|
|
|
|
|
<Scatter
|
|
|
|
|
data={{
|
|
|
|
|
datasets: [
|
|
|
|
@ -366,15 +363,15 @@ export function HistoricalCalendarPrices() {
|
|
|
|
|
events: [],
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
) : (
|
|
|
|
|
<div className="h-full">Loading Chart...</div>
|
|
|
|
|
<Typography>Loading Chart...</Typography>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
<div className="min-h-96">
|
|
|
|
|
</Paper>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={12}>
|
|
|
|
|
<Paper elevation={3} sx={{ p: 3 }}>
|
|
|
|
|
{chosenUnderlying.value !== null &&
|
|
|
|
|
historicalCalendarQuoteChartData.value.length > 0 ? (
|
|
|
|
|
<div className="h-full">
|
|
|
|
|
<Scatter
|
|
|
|
|
data={{
|
|
|
|
|
datasets: [
|
|
|
|
@ -433,15 +430,15 @@ export function HistoricalCalendarPrices() {
|
|
|
|
|
events: [],
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
) : (
|
|
|
|
|
<div className="h-full">Loading Chart...</div>
|
|
|
|
|
<Typography>Loading Chart...</Typography>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
<div className="min-h-96">
|
|
|
|
|
</Paper>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={12}>
|
|
|
|
|
<Paper elevation={3} sx={{ p: 3 }}>
|
|
|
|
|
{chosenUnderlying.value !== null &&
|
|
|
|
|
historicalCalendarQuoteChartData.value.length > 0 ? (
|
|
|
|
|
<div className="h-full">
|
|
|
|
|
<Scatter
|
|
|
|
|
data={{
|
|
|
|
|
datasets: [
|
|
|
|
@ -509,13 +506,12 @@ export function HistoricalCalendarPrices() {
|
|
|
|
|
events: [],
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
) : (
|
|
|
|
|
<div className="h-full">Loading Chart...</div>
|
|
|
|
|
<Typography>Loading Chart...</Typography>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</Paper>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Container>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|