ah
unknown
plain_text
10 months ago
4.4 kB
5
Indexable
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Investment Analysis Tool</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 800px;
margin: 0 auto;
padding: 20px;
}
.input-group {
margin-bottom: 15px;
}
label {
display: block;
margin-bottom: 5px;
}
input {
width: 100%;
padding: 8px;
margin-bottom: 10px;
}
button {
background-color: #4CAF50;
color: white;
padding: 10px 20px;
border: none;
cursor: pointer;
}
#result {
margin-top: 20px;
padding: 15px;
border: 1px solid #ddd;
}
</style>
</head>
<body>
<h1>Investment Analysis Tool</h1>
<div class="input-group">
<label for="companyName">Company Name:</label>
<input type="text" id="companyName" required>
<label for="peRatio">P/E Ratio:</label>
<input type="number" id="peRatio" required>
<label for="debtEquity">Debt to Equity Ratio:</label>
<input type="number" id="debtEquity" required>
<label for="profitMargin">Profit Margin (%):</label>
<input type="number" id="profitMargin" required>
<label for="revenueGrowth">Revenue Growth Rate (%):</label>
<input type="number" id="revenueGrowth" required>
<button onclick="analyzeInvestment()">Analyze Investment</button>
</div>
<div id="result"></div>
<script>
function analyzeInvestment() {
const companyName = document.getElementById('companyName').value;
const peRatio = parseFloat(document.getElementById('peRatio').value);
const debtEquity = parseFloat(document.getElementById('debtEquity').value);
const profitMargin = parseFloat(document.getElementById('profitMargin').value);
const revenueGrowth = parseFloat(document.getElementById('revenueGrowth').value);
let score = 0;
let recommendations = [];
// P/E Ratio Analysis
if (peRatio < 15) {
score += 25;
recommendations.push("P/E ratio indicates the stock might be undervalued");
} else if (peRatio > 30) {
recommendations.push("High P/E ratio suggests potential overvaluation");
}
// Debt to Equity Analysis
if (debtEquity < 1) {
score += 25;
recommendations.push("Healthy debt levels");
} else {
recommendations.push("High debt levels - consider monitoring");
}
// Profit Margin Analysis
if (profitMargin > 10) {
score += 25;
recommendations.push("Strong profit margins");
}
// Revenue Growth Analysis
if (revenueGrowth > 10) {
score += 25;
recommendations.push("Good revenue growth rate");
}
// Investment Timeline
let timeline = "";
if (score >= 75) {
timeline = "Long-term investment (3-5+ years)";
} else if (score >= 50) {
timeline = "Medium-term investment (1-3 years)";
} else {
timeline = "Not recommended for investment at this time";
}
// Display Results
document.getElementById('result').innerHTML = `
<h3>Analysis Results for ${companyName}</h3>
<p><strong>Investment Score:</strong> ${score}/100</p>
<p><strong>Recommended Timeline:</strong> ${timeline}</p>
<h4>Key Findings:</h4>
<ul>
${recommendations.map(rec => `<li>${rec}</li>`).join('')}
</ul>
`;
}
</script>
</body>
</html>Editor is loading...
Leave a Comment