The mathematical formula for calculating profit factor to evaluate trading system quality.
Total winning trades: $15,000, Total losing trades: $8,000 Profit Factor = $15,000 / $8,000 = 1.875 Net Profit = $15,000 - $8,000 = $7,000 Assessment: Good (above 1.5 is considered good)
from gfil_calculators.position_size import calculate_profit_factor
result = calculate_profit_factor(15000, 8000)
print(f"PF: {{result['profit_factor']}}, Net: ${{result['net_profit']}}")