Formulas for Payoff at Expiry

Discussion in 'Options' started by Quanto, Mar 9, 2024.

  1. Quanto

    Quanto

    Formulas for Payoff at Expiry (Black-Scholes not required at/for expiry)

    The PnL(S) column shows the formula for computing the outcome (payoff) at expiry for any stock price (S) you supply.

    If you spot an error or want to make improvements/additions/extensions, let me know.
    This is a WIP (work in progress).

    ATTN: Non-programmers should not participate in this thread, as this is mostly interesting,
    and is intended, for programmers only.

    Code:
    Formulas for Payoff at Expiry
    (Black-Scholes not required at/for expiry)
    
    Abbrevations:
      S         Stock Price
      S0        Initial Stock Price
      Pr0       Initial Option Premium (ie. the Option Price)
      K         Option Strike
      BEP       Break/Even Point (the stock price at which PnL is 0)
      PnL(S)    The formula for computing PnL for any S
      Infinity  means "unlimited"
    
                    Type       NetPr       MinPnL       MaxPnL        BEP         ProfitZone     PnL(S)
    ----------------------------------------------------------------------------------------------------------------------------------------
    LongStock       Bullish    -S0         -S0          +Infinity     S0          BEP.right      S
    
    ShortStock      Bearish     S0         -Infinity     S0           S0          BEP.left       S
    
    LongCall        Bullish    -Pr0        -Pr0         +Infinity     K + Pr0     BEP.right      max(S - K - Pr0, -Pr0)
    
    ShortCall       Bearish     Pr0        -Infinity     Pr0          K + Pr0     BEP.left       min(K - S + Pr0,  Pr0)
    
    LongPut         Bearish    -Pr0        -Pr0          K - Pr0      K - Pr0     BEP.left       max(K - S - Pr0, -Pr0)
    
    ShortPut        Bullish     Pr0        -K + Pr0      Pr0          K - Pr0     BEP.right      min(S - K + Pr0,  Pr0)
    
    CoveredCall     Bullish    -S0 + Pr0    NetPr        K - Pr0      S0 - Pr0    BEP.right      S < 0.0 ? MinPnL : S > K ? MaxPnL : MinPnL + S
    (= LS + SC)
    
    CashSecuredPut  Bullish    -K  + Pr0    NetPr        K - Pr0      K  - Pr0    BEP.right      S < 0.0 ? MinPnL : S > K ? MaxPnL : MinPnL + S
    (= SP + Cash)
    
    
     
    Last edited: Mar 9, 2024
  2. Zwaen

    Zwaen

    When I was in finance class, we had to draw the combinations-payoff. Wonderful days :)
     
    Quanto likes this.
  3. Quanto

    Quanto

    The following pseudocode is equivalent to "PnL = S < 0.0 ? MinPnL : S > K ? MaxPnL : MinPnL + S" :
    Code:
    if (S < 0.0)
      PnL = MinPnL
    else if (S > K)
      PnL = MaxPnL
    else
      PnL = MinPnL + S
    
     
    Last edited: Mar 9, 2024
  4. Quanto

    Quanto

    To get the PnL for S=S0 one would make this call:
    PnL = PnL(S0)
    And from that result one can calculate PnL% etc.:
    PnL% = PnL / abs(NetPr) * 100
    (does make sense only for strategies where NetPr is negative, for example CC and CSP)

    The posted formulas can be used for scanning option chain tables: to find good trades in the data.
     
  5. newwurldmn

    newwurldmn

    The best way to determine payoffs at expiry is to use numerical methods combined with machine learning.
     
  6. Quanto

    Quanto

    What a BS!
    My posted payoff formulas are exact formulas, nothing can be more exact than these!

    Here are other examples that do similar by using the same payoff formulas (or similar payoff formulas giving the same result):
    https://www.macroption.com/call-option-payoff/
    I have verified my results with that site as well with Black-Scholes. All 3 give the same result.

    This is my test program for verifying the 3 results for the LC, SC, LP, SP:
    the calc_BSM() function is not posted, you can use your own.
    Code:
    int payoff_tests()
      { // compares 3 different formulas: 1=BSM, 2=my, 3=www.macroption.com
    
        const double S0 = 120, DTE = 365, IV = 300, rPct = 0, qPct = 0;
        const double Step = 1.0;
    
        size_t c = 0;
    
        for (int ifC = 1; ifC >= 0; --ifC)
        for (int ifL = 1; ifL >= 0; --ifL)
        for (double K = S0 * 0.25; K <= (S0 * 1.75); K += Step)
          {
            const TSCP   CP0 = calc_BSM(S0, K, DTE / gPar.DaysInYear, IV / 100, rPct / 100, qPct / 100);
            const double Pr0 = ifC ? CP0.C : CP0.P;
        
            for (double S = S0 * 0.1; S <= (S0 * 1.9); S += Step)
              {
                ++c;
          
                const TSCP   CP = calc_BSM(S, K, 0.0, IV / 100, rPct / 100, qPct / 100);         // t=0 ist OK
                const double Pr = ifC ? CP.C : CP.P;
    
                double y1 = 0, y2 = 0, y3 = 0;
    
                if (ifC && ifL)
                  {
                    y1 = -Pr0 + Pr;
                    y2 = max(S - K - Pr0, -Pr0);
                    y3 = max(S - K, 0.0) - Pr0;
                  }
    
                if (ifC && !ifL)
                  {
                    y1 = Pr0 - Pr;
                    y2 = min(K - S + Pr0,  Pr0);
                    y3 = Pr0 - max(0.0, S - K);
                  }
    
                if (!ifC && ifL)
                  {
                    y1 = -Pr0 + Pr;
                    y2 = max(K - S - Pr0, -Pr0);
                    y3 = max(K - S, 0.0) - Pr0;
                  }
    
                if (!ifC && !ifL)
                  {
                    y1 = Pr0 - Pr;
                    y2 = min(S - K + Pr0,  Pr0);
                    y3 = Pr0 - max(0.0, K - S);
                  }
    
    
                const bool fDiff = cmp(y1, y2) || cmp(y2, y3);
                if (!fDiff) continue;            
            
                printf("ERROR: RESULTS DIFFER: fC=%d fL=%d S0=%-8.4lf IV=%.2lf K=%-8.2lf Sx=%-8.2lf : y1=%-8.4lf y2=%-8.4lf y3=%-8.4lf\n",
                                               ifC,  ifL,  S0,        IV,      K,        S,           y1,        y2,        y3);
                return 1;
              }
          }
        printf("c=%zu : ALL OK\n", c);
    
        return 0;
      }
    
     
    Last edited: Mar 9, 2024
  7. 2rosy

    2rosy

    They flys will tell you everything
     
  8. Quanto

    Quanto

    What do you mean?
     
  9. ondafringe

    ondafringe

    02-Q.PNG
    In your OP, it's obvious you don't know how to handle infinity. With my superior math skills, let me give you some basic instruction on infinity:

    infinity + infinity = two-finity

    infinity - infinity = no-finity

    Got it? Good. You can take it from here.
     
    newwurldmn and schizo like this.
  10. schizo

    schizo

    :D :D:D
     
    #10     Mar 9, 2024
    ondafringe likes this.