Market Reset Calculator For Gold-Making (Patreon)
Content
The following program is code for a simple html calculator that calculates the mathematics of a potential market reset in the wow auction house.
To use the file cut and past the code into notepad and then save it as something with a .htm extension. It should then open in a brower when you open the file again.
I went into some detail about how to do market resets in a recent video so I'm not going to go into further detail on how to do this here. Mostly the calculator is self-explanatory.
This calculator is currently still in beta at the time of posting and may have bugs/issues.
Please tell me if you would prefer another format such as .exe. I'm wary of posting anything which could get flagged as a virus erroneously but I'm happy to listen to alternative suggestions.
(Highlight the code inbetween the lines and press ctrll+c to copy the document then paste into notepad)
_______________________________________________________________
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-inline' 'unsafe-eval'">
<title>WoW Market Reset Calculator</title>
<!-- Previous style section remains the same -->
<style>
body {
font-family: Arial, sans-serif;
max-width: 800px;
margin: 0 auto;
padding: 20px;
}
.input-group {
margin-bottom: 15px;
padding: 10px;
border: 1px solid #eee;
border-radius: 5px;
}
.input-group h3 {
margin-top: 0;
}
input, button {
margin: 5px 0;
padding: 5px;
}
#results {
margin-top: 20px;
padding: 15px;
background-color: #f5f5f5;
border-radius: 5px;
}
.risk-high { color: #d32f2f; }
.risk-medium { color: #f57c00; }
.risk-low { color: #388e3c; }
</style>
</head>
<body>
<!-- Previous HTML content remains exactly the same -->
<h1>WoW Market Reset Calculator with Risk Analysis</h1>
<div class="input-group">
<h3>Basic Information</h3>
<div>
<label for="numItems">Number of Items:</label>
<input type="number" id="numItems" value="100">
</div>
<div>
<label for="purchasePrice">Purchase Price per Item:</label>
<input type="number" id="purchasePrice" value="50">
</div>
<div>
<label for="targetPrice">Target Selling Price:</label>
<input type="number" id="targetPrice" value="75">
</div>
<div>
<label for="ahCut">Auction House Cut (%):</label>
<input type="number" id="ahCut" value="5">
</div>
</div>
<div class="input-group">
<h3>Market Recovery Risk Factors</h3>
<div>
<label for="marketVolume">Daily Market Volume (items traded):</label>
<input type="number" id="marketVolume" value="200">
</div>
<div>
<label for="competitorCount">Number of Known Competitors:</label>
<input type="number" id="competitorCount" value="3">
</div>
<div>
<label for="recoverySpeed">Expected Market Recovery Speed (hours):</label>
<input type="number" id="recoverySpeed" value="24">
</div>
<div>
<label for="priceVolatility">Price Volatility (% daily change):</label>
<input type="number" id="priceVolatility" value="10">
</div>
</div>
<button onclick="calculate()">Calculate</button>
<div id="results"></div>
<script type="text/javascript">
// Previous JavaScript functions remain exactly the same
function calculateRiskFactors(marketVolume, competitorCount, recoverySpeed, priceVolatility) {
const factors = {
volumeRisk: Math.min(1, 1 - (marketVolume / 1000)),
competitorRisk: Math.min(1, competitorCount / 10),
recoveryRisk: Math.min(1, 24 / recoverySpeed),
volatilityRisk: Math.min(1, priceVolatility / 100)
};
const weightedRisk = (
(factors.volumeRisk * 0.3) +
(factors.competitorRisk * 0.25) +
(factors.recoveryRisk * 0.25) +
(factors.volatilityRisk * 0.2)
);
return {
...factors,
weightedRisk
};
}
function getRiskLevel(riskScore) {
if (riskScore < 0.3) return ['Low', 'risk-low'];
if (riskScore < 0.6) return ['Medium', 'risk-medium'];
return ['High', 'risk-high'];
}
function calculate() {
const numItems = parseFloat(document.getElementById('numItems').value);
const purchasePrice = parseFloat(document.getElementById('purchasePrice').value);
const targetPrice = parseFloat(document.getElementById('targetPrice').value);
const ahCut = parseFloat(document.getElementById('ahCut').value) / 100;
const marketVolume = parseFloat(document.getElementById('marketVolume').value);
const competitorCount = parseFloat(document.getElementById('competitorCount').value);
const recoverySpeed = parseFloat(document.getElementById('recoverySpeed').value);
const priceVolatility = parseFloat(document.getElementById('priceVolatility').value);
const initialInvestment = numItems * purchasePrice;
const netSellingPrice = targetPrice * (1 - ahCut);
const netProfitPerItem = netSellingPrice - purchasePrice;
const totalNetProfit = numItems * netProfitPerItem;
const roi = (totalNetProfit / initialInvestment) * 100;
const riskFactors = calculateRiskFactors(marketVolume, competitorCount, recoverySpeed, priceVolatility);
const [riskLevel, riskClass] = getRiskLevel(riskFactors.weightedRisk);
const riskAdjustedProfit = totalNetProfit * (1 - riskFactors.weightedRisk);
const riskAdjustedROI = (riskAdjustedProfit / initialInvestment) * 100;
const estimatedSellTime = numItems / (marketVolume * (1 - riskFactors.weightedRisk));
const recoveryRisk = estimatedSellTime > (recoverySpeed / 24) ? 'High' : 'Low';
const results = `
<h2>Results:</h2>
<h3>Basic Calculations</h3>
<p>Initial Investment: ${initialInvestment.toFixed(2)} gold</p>
<p>Net Selling Price (after AH cut): ${netSellingPrice.toFixed(2)} gold</p>
<p>Maximum Potential Profit: ${totalNetProfit.toFixed(2)} gold</p>
<p>Maximum Potential ROI: ${roi.toFixed(2)}%</p>
<h3>Risk Analysis</h3>
<p class="${riskClass}">Overall Risk Level: ${riskLevel} (${(riskFactors.weightedRisk * 100).toFixed(1)}%)</p>
<p>Risk-Adjusted Profit: ${riskAdjustedProfit.toFixed(2)} gold</p>
<p>Risk-Adjusted ROI: ${riskAdjustedROI.toFixed(2)}%</p>
<p>Estimated Sell Time: ${estimatedSellTime.toFixed(1)} days</p>
<p>Market Recovery Risk: ${recoveryRisk}</p>
<h3>Risk Factors:</h3>
<ul>
<li>Market Volume Impact: ${(riskFactors.volumeRisk * 100).toFixed(1)}%</li>
<li>Competitor Impact: ${(riskFactors.competitorRisk * 100).toFixed(1)}%</li>
<li>Recovery Speed Impact: ${(riskFactors.recoveryRisk * 100).toFixed(1)}%</li>
<li>Volatility Impact: ${(riskFactors.volatilityRisk * 100).toFixed(1)}%</li>
</ul>
`;
document.getElementById('results').innerHTML = results;
}
// Add this line to ensure JavaScript runs on page load
document.addEventListener('DOMContentLoaded', function() {
// Initial calculation to show results
calculate();
});
</script>
</body>
</html>
_______________________________________________________________