Smart Money Index (SMI) Daily Change Illustrator
Manually input daily market index changes to illustrate the SMI calculation for one day.
** VERY IMPORTANT - PLEASE READ **
- This tool is for educational purposes ONLY to demonstrate the SMI calculation for a single day based on your inputs.
- It does **NOT** use live or historical market data, nor does it track or plot the SMI over time.
- The Smart Money Index is a technical indicator with specific interpretations (often looking for divergences with price). This tool only performs the basic daily calculation.
- This is **NOT investment advice**. Trading or investment decisions should not be based solely on this illustrative calculation.
- Always conduct thorough research and consult with qualified financial professionals.
Enter Daily Market Index Data
points/$
points/$
Smart Money Index (SMI) Calculation
${this.formatNumber(todaySMI)}
`; this.elements.calculationExplanation.innerHTML = `Calculation Breakdown:
Yesterday's SMI: ${this.formatNumber(yesterdaySMI)}
(-) Index Change in First Hour: ${this.formatNumber(firstHourChange)}
(+) Index Change in Last Hour: ${this.formatNumber(lastHourChange)}
Today's SMI = ${this.formatNumber(yesterdaySMI)} - (${this.formatNumber(firstHourChange)}) + (${this.formatNumber(lastHourChange)}) = ${this.formatNumber(todaySMI)}
`; this.elements.resultsSection.style.display = 'block'; }, generatePDF: async function() { if (!window.jspdf || !window.html2canvas || Object.keys(this.resultsData).length === 0) { alert('Please calculate the SMI first to generate a PDF.'); return; } await new Promise(resolve => setTimeout(resolve, 50)); const i = this.resultsData.inputs; const o = this.resultsData.outputs; const pdfExportContainer = document.createElement('div'); pdfExportContainer.classList.add('smi-pdf-export-content'); pdfExportContainer.style.width = '600px'; // Consistent width for rendering let pdfHtml = `SMI Daily Change Illustration
`; pdfHtml += `Disclaimer: Educational tool, manual inputs for a single day. NOT investment advice. Consult professionals. SMI is a cumulative index; this shows one day's change.
`;
pdfHtml += `Inputs Provided
`;
pdfHtml += `
`;
pdfHtml += `Yesterday's SMI Value: ${this.formatNumber(i.yesterdaySMI)}
`;
pdfHtml += `Index Change in First Hour: ${this.formatNumber(i.firstHourChange)} points/$
`;
pdfHtml += `Index Change in Last Hour: ${this.formatNumber(i.lastHourChange)} points/$
`;
pdfHtml += `Calculation Result
`; pdfHtml += `Today's Calculated SMI Value: ${this.formatNumber(o.todaySMI)}
`;
pdfHtml += `Calculation Breakdown:
`;
pdfHtml += `
`;
pdfExportContainer.innerHTML = pdfHtml;
document.body.appendChild(pdfExportContainer);
try {
const canvas = await html2canvas(pdfExportContainer, {
scale: 2,
useCORS: true,
logging: false
});
document.body.removeChild(pdfExportContainer);
const imgData = canvas.toDataURL('image/png');
const { jsPDF } = window.jspdf;
const pdf = new jsPDF({
orientation: 'p',
unit: 'pt',
format: 'a4'
});
const pdfWidth = pdf.internal.pageSize.getWidth();
const imgProps = pdf.getImageProperties(imgData);
const imgWidth = pdfWidth - 40;
const imgHeight = (imgProps.height * imgWidth) / imgProps.width;
pdf.addImage(imgData, 'PNG', 20, 20, imgWidth, imgHeight);
pdf.save('SMI_Daily_Calculation.pdf');
} catch (error) {
console.error("Error generating PDF:", error);
alert("An error occurred while generating the PDF.");
if (document.body.contains(pdfExportContainer)) {
document.body.removeChild(pdfExportContainer);
}
}
}
};
document.addEventListener('DOMContentLoaded', function() {
smiApp.init();
});
Today's SMI = Yesterday's SMI - First Hour Change + Last Hour Change
`; pdfHtml += `= ${this.formatNumber(i.yesterdaySMI)} - (${this.formatNumber(i.firstHourChange)}) + (${this.formatNumber(i.lastHourChange)}) = ${this.formatNumber(o.todaySMI)}
`; pdfHtml += `