Creating Ratios
Learn how to create custom financial ratios using the Ratio Maker tool.
What are Financial Ratios?
Financial ratios are calculations that use financial statement data to measure:
- Profitability (e.g., Profit Margin, ROE)
- Liquidity (e.g., Current Ratio, Quick Ratio)
- Leverage (e.g., Debt-to-Equity)
- Efficiency (e.g., Asset Turnover)
- Valuation (e.g., P/E Ratio, P/B Ratio)
Opening the Ratio Maker
From Excel
- Open
FinForge.xlsm - Run the macro:
OpenRatioMaker()- Press
Alt + F8 - Select
OpenRatioMaker - Click Run
- Press
From Python
cd <project-root>
.\.venv\Scripts\Activate.ps1
python Importing/ratio_maker.py
From Electron UI
- Open the FinForge workspace window
- Click the Metrics tab
- Use the formula builder with token buttons and field pickers
- Save ratios directly to the shared config
Built-in Ratios
FinForge ships with a ready-made set of the most widely used financial ratios, so you do not have to build them yourself before you can analyse a company.
They live inside the built-in Beginning Template. Open the Templates tab and the Beginning Template is listed with a lock icon. Select it and click Load template to copy its ratios into your workspace. The Metrics tab then lists all of them, grouped by category:
| Category | Examples |
|---|---|
| Liquidity | Current Ratio, Quick Ratio, Cash Ratio, Working Capital, Operating Cash Flow Ratio |
| Profitability | Gross Margin, Operating Margin, Net Profit Margin, EBITDA Margin, Return on Assets, Return on Equity, Return on Invested Capital, Return on Capital Employed |
| Efficiency | Asset Turnover, Inventory Turnover, Receivables Turnover, Days Sales Outstanding, Cash Conversion Cycle |
| Leverage and Solvency | Debt to Equity, Debt to Assets, Net Debt to EBITDA, Interest Coverage, Equity Multiplier |
| Cash Flow | Operating Cash Flow Margin, Free Cash Flow Margin, Cash Flow to Net Income, Dividend Payout Ratio |
| Valuation | P/E Ratio, PEG Ratio, Price to Book, EV/EBITDA, EV/Revenue, Dividend Yield |
| Growth and Per Share | Revenue Growth YoY, EPS Growth YoY, Book Value per Share, Free Cash Flow per Share |
Notes on how they behave:
- Most ratios are calculated from the financial statements, so they follow the statement periods and produce a history you can chart.
- The Valuation ratios come from live market data and show a single current value rather than a history. That is a limit of the data provider, not of the ratio.
- Growth ratios report percentages, so
12.5means twelve and a half percent. All other ratios report a decimal fraction, so0.125means twelve and a half percent. - Each ratio carries a short note explaining what it measures.
The Beginning Template itself cannot be edited or deleted. You can still change any of its ratios after loading it, and you can add, rename or delete your own ratios as usual.
Creating Your First Ratio
Step 1: Click “New Ratio”
The Create Ratio dialog opens.
Step 2: Enter Ratio Name
Give your ratio a descriptive name:
- “Gross Margin”
- “Current Ratio”
- “Debt to Equity”
Step 3: Build the Formula
Use the field selector and operators to build your formula.
Available Data Sources:
| Prefix | Source | Example Fields |
|---|---|---|
IS: |
Income Statement | Total Revenue, Net Income, EBITDA |
BS: |
Balance Sheet | Total Assets, Total Debt, Cash |
CF: |
Cash Flow | Operating Cash Flow, Free Cash Flow |
P: |
Price/Market Data | Closing Price, Volume, High, Low |
RATIO: |
Other Ratios | Use your previously created ratios |
Available Operators:
| Button | Operation |
|---|---|
+ |
Addition |
- |
Subtraction |
* |
Multiplication |
/ |
Division |
( |
Open parenthesis |
) |
Close parenthesis |
Step 4: Add Notes (Optional)
Add a description or notes about the ratio:
- What it measures
- How to interpret it
- Reference ranges
Step 5: Save
Click Save to store the ratio in ratio_config.json.
Formula Examples
Profitability Ratios
Gross Margin
(IS: Total Revenue - IS: Cost Of Revenue) / IS: Total Revenue
Operating Margin
IS: Operating Income / IS: Total Revenue
Net Profit Margin
IS: Net Income / IS: Total Revenue
Return on Assets (ROA)
IS: Net Income / BS: Total Assets
Return on Equity (ROE)
IS: Net Income / BS: Stockholders Equity
Liquidity Ratios
Current Ratio
BS: Current Assets / BS: Current Liabilities
Quick Ratio
(BS: Current Assets - BS: Inventory) / BS: Current Liabilities
Leverage Ratios
Debt to Equity
BS: Total Debt / BS: Stockholders Equity
Debt to Assets
BS: Total Debt / BS: Total Assets
Efficiency Ratios
Asset Turnover
IS: Total Revenue / BS: Total Assets
Using Other Ratios
ROE using DuPont Analysis
RATIO: Net Profit Margin * RATIO: Asset Turnover * RATIO: Equity Multiplier
Using Numbers
Interest Coverage (example with constant)
IS: EBIT / IS: Interest Expense
Half of Net Debt
BS: Net Debt / 2
Understanding Syntax Highlighting
As you type, the formula is color-coded:
| Color | Meaning |
|---|---|
| Green | Income Statement fields (IS:) |
| Light Blue | Balance Sheet fields (BS:) |
| Purple | Price/Cash Flow fields |
| Orange | Operators (+, -, *, /) |
| Yellow | Parentheses |
| Gold | Other Ratios (RATIO:) |
| Light Blue | Numbers |
| Red + Wavy | Errors (typos, invalid fields) |
Using the Fraction Display
For visual clarity, you can toggle fraction display:
- Check “Use Fraction Display” checkbox
- The division button changes to show a fraction bar
- Formulas are easier to read visually
Editing Existing Ratios
- Select the ratio in the list
- Click Edit
- Modify the name, formula, or notes
- Click Save
Note: If the ratio is assigned to an Excel column, the column header is automatically updated with the new name.
Deleting Ratios
- Select the ratio in the list
- Click Delete
- Confirm the deletion
Warning: If the ratio is assigned to an Excel column, unassign it first.
Where are Ratios Stored?
Ratios are saved in: Importing/ratio_config.json
The file is a flat map of ratio name to definition:
{
"Gross Margin": {
"formula": "(IS: Total Revenue - IS: Cost Of Revenue) / IS: Total Revenue",
"notes": "Measures profitability after direct costs",
"row": "",
"folder": "Profitability"
},
"Current Ratio": {
"formula": "BS: Current Assets / BS: Current Liabilities",
"notes": "Measures short-term liquidity",
"row": "",
"folder": "Liquidity"
}
}
| Field | Meaning |
|---|---|
formula |
The calculation. Uses BS:, IS:, CF:, P:, M: and other references. |
notes |
Optional description shown in the Metrics tab. |
row |
Optional fixed row in the Excel Metrics sheet. Leave empty to auto-assign from row 7. |
folder |
Category used by the folder filter and the Folders subtab. Leave empty for ungrouped. |
Tips for Creating Good Ratios
- Use descriptive names - “Gross Margin” not “GM1”
- Add notes - Document what the ratio measures
- Test with known values - Verify calculations are correct
- Use parentheses - Ensure correct order of operations
- Check field names - Use exact field names from the data
Troubleshooting
Red Error Highlighting
Cause: Invalid field name Solution: Check spelling, use the field selector dropdown
“Field not found” Error
Cause: Field doesn’t exist in the data Solution: See Available Data Reference for valid field names
Calculation Shows #N/A
Cause:
- Data missing for the ticker
- Division by zero
Solution:
- Verify data exists for the ticker
- Add logic to handle zero denominators
Ratio Not Appearing in Manager
Cause: Save failed or file permission issue Solution:
- Check if ratio_config.json is writable
- Try saving again
Next Steps
After creating ratios: