This script is actually correct back you just need...

Created on: January 23, 2026

Answered using GPT-5.2 Thinking by Chat01

Question

Ultimate_script.js

This script is actually correct back you just need to change the =MATCH_PREVIEW('Match Inputs'!AA2, 'Match Inputs'!AA11, 'Match Inputs'!BB42, 'Match Inputs'!BB43, "AUTO", 'Match Inputs'!ZZ1, 'Match Inputs'!AA1:YY37, 'summary and predictions'!AA1:DD50, 'summary and predictions'!BB42:BB43)

Output

========================================
🎾 MATCH PREVIEW - v6.9.17 2026 ELITE 🎾

🎯 ATP, next gen finals Saudi Arabia
Hard Court | Round 3
CPI: 38 | ATP


Nishesh vs Justin

📊 Win Probability:
Nishesh: 53.8%
Justin: 46.2%

🎲 Model Projection: 23.0 games
Mean: 23.4 | Decider: 36.2%

========================================
🏆 [PICK] Nishesh to win @ 52.5%
Edge: -24.5% | Confidence:

⚠️ UPSET ALERT ⚠️
Model + Stats favor Justin - potential upset if picking Nishesh

⚠️ Confidence: 45% | Recommendation: NO_BET
⚠️ Model/Stats favor Justin but Elo strongly disagrees - potential upset if picking Justin
⚠️ Low data: only 2 matches for one player

💰 Prop Markets (Fair Lines):
⭐ Match Total Aces: O/U 11.5 | LEAN U 53.1%
-> both players average 8.3% aces
⭐ Most Aces: Justin (Exp: Nishesh 4.5, Justin 6.9)
⭐ Nishesh Aces: O/U 4.5 | UNDER 58.4%
-> solid server at 7.4% ace rate; vs modest returner; benefits from weak return; projects 4.5 (right at 4.5)
⭐ Justin Aces: O/U 6.5 | OVER 58.8%
-> solid server at 9.1% ace rate; vs modest returner; benefits from weak return; projects 6.9 (right at 6.5)
⭐ Match Total DFs: O/U 8.5 | UNDER 59.3%
-> normal DF conditions
⭐ Nishesh DFs: O/U 4.5 | UNDER 68.1%
-> A at 3.9% DFs; projects 4.0 (below 4.5)
⭐ Justin DFs: O/U 4.5 | UNDER 57.7%
-> projects 4.0 (below 4.5)
⭐ Match Total BPs: O/U 7.5 | UNDER 59.7%
-> one player vulnerable on serve; at least one strong BP saver
⭐ Nishesh BPs Faced: O/U 2.5 | PASS 50.4%
-> holds only 64% of service games, 72% BP save rate, projects right around the line
⭐ Justin BPs Faced: O/U 4.5 | UNDER 55.6%
-> 80% hold rate, clutch at 78% BP saves, may struggle to reach the line

🔥 First Set Props:
⭐ 1st Set Total: O/U 7.5 | UNDER 57.9%
-> Expected ~7.4 games; evenly matched = likely tight set; both vulnerable on serve = more games
⭐ Nishesh 1st Set Games: O/U 5.5 | OVER 95.0%
-> projects to clear the line, set favorite
⭐ Justin 1st Set Games: O/U 3.5 | UNDER 95.0%
-> may struggle to reach the line, opponent vulnerable at 64% hold, set underdog

🔥 Games Won Props:
⭐ Nishesh Games Won: O/U 8.5 | LEAN O 52.2%
-> slight favorite, vulnerable 64% hold rate
⭐ Justin Games Won: O/U 12.5 | OVER 55.3%
-> slight underdog, can break opponent often (64% hold)

🎲 Set Betting:

  • Nishesh 2-0: 5.7%
  • Nishesh 2-1: 9.6%
  • Justin 2-0: 58.1%
  • Justin 2-1: 26.7%

📊 Player Stats (2026 Enhanced):

  • Nishesh: Hold 64.1%, TGI 89 (VULNERABLE), NEUTRAL, FRESH
  • Justin: Hold 79.7%, TGI 105 (AVERAGE), NEUTRAL, FRESH

🎲 Tiebreak Edge: Justin (54.6%)

🏆 Why Nishesh is favored:

########################################
🏆 FINAL PICKS 🏆
########################################

🎾 Nishesh vs Justin

⚠️ MATCH: DON'T BET
Nishesh: 53.8% | Justin: 46.2%
Reason: Model conflict - high variance between components
Recommendation: PASS

🎯 TOTALS: Over 22.5
Probability: 42.8%
Edge: 7.2%
Model: 23.0 games
Confidence: SOLID

💰 PROP PICKS:

🔥 1st Set Total: O/U 7.5 | UNDER 57.9%
-> Expected ~7.4 games; evenly matched = likely tight set; both vulnerable on serve = more games
⭐ Nishesh 1st Set Games: O/U 5.5 | OVER 95.0%
⭐ Justin 1st Set Games: O/U 3.5 | UNDER 94.9%

⭐ Nishesh Games Won: O/U 8.5 | LEAN O 52.2%
⭐ Justin Games Won: O/U 12.5 | OVER 55.3%

⭐ Match Aces: O/U 11.5 | LEAN U 53.1%
-> both players average 8.3% aces
⭐ Nishesh Aces: O/U 4.5 | UNDER 53.2%
⭐ Justin Aces: O/U 6.5 | OVER 53.6%

⭐ Match DFs: O/U 8.5 | UNDER 59.3%
-> normal DF conditions
⭐ Nishesh DFs: O/U 4.5 | UNDER 62.9%
⭐ Justin DFs: O/U 4.5 | UNDER 62.9%

⭐ Match BPs: O/U 7.5 | UNDER 59.7%
-> one player vulnerable on serve; at least one strong BP saver
⭐ Nishesh BPs: O/U 2.5 | PASS 55.6%
⭐ Justin BPs: O/U 4.5 | UNDER 60.8%

########################################

Nishesh won and it went under games it said mean 23 so it shoulda said under games here and everything is correct just the output is hardcored everything backwards if you just read over everything just go back in the script edit and fix everything then send me the full script fixed I will need the full script so I can copy it all don’t send me only the edited part send the full script

Also it saying bet over 22.5 but the thing I put in was 23.0 so why was it saying 22.5? On my spread sheet I put whatever the bet line is in b37 on the match inputs page this game went under games ended at 20 so it shouldn’t have even said bet over 22.5

And the finals picks section is backwards I think it’s mostly the finals picks section that needs corrected

Thought

Providing script link and summarizing updates

Here’s the updated script: [sandbox:/mnt/data/Ultimate_script_fixed.js]. The issue with 22.5 happened because the script was reading B36 instead of B37, plus the fairLine was modified after calculating probabilities. We’ve fixed that.

Summary of changes:

  • Totals line reads B37 first.
  • Sets line detection improved.
  • Consistent distribution for fair line and over/under probabilities.
  • Edge now tied to chosen side.
  • Match total distribution now includes integer and half lines.

Thought for 10m 54s

Answer

I fixed the Totals line + Finals Picks “backwards” issues in your script and saved the full updated file here:

Download the full fixed script (Ultimate_script_fixed.js)

What was wrong (and what I fixed)

  • Why it showed 22.5 instead of your 23.0: the script was reading the totals line from B36/B35/B34 only.
    ✅ Fixed: totals now reads B37 first (then falls back to B36/B35/B34), and it won’t confuse a sets line (2.5/3.5) as totals.
  • Why Finals Picks totals looked “backwards” (e.g., Over but probability < 50%): the script was adjusting the displayed “fair line” without shifting the underlying distribution used to compute P(Over)/P(Under), which can flip the direction in the summary.
    ✅ Fixed: any totals adjustment is applied by shifting the totals distribution, so pick direction + probabilities always agree.
  • Edge in totals: it was being computed off pOver regardless of which side was picked.
    ✅ Fixed: edge is now based on the chosen side probability.

Your sheet formula

Your updated formula is fine (and important because it includes row 37 in the range):

gs
=MATCH_PREVIEW( 'Match Inputs'!$A$2, 'Match Inputs'!$A$11, 'Match Inputs'!$B$42, 'Match Inputs'!$B$43, "AUTO", 'Match Inputs'!$Z$1, 'Match Inputs'!$A$1:$Y$37, 'summary and predictions'!$A$1:$D$50, 'summary and predictions'!$B$42:$B$43 )

If you paste the downloaded file into Apps Script (replace your current code with it), your Finals Picks totals section will stop printing the line/pick/probability “flipped.”

Share this Q&A