Percent Calc Problem

Discussion in 'Options' started by earth_imperator, May 25, 2022.

  1. @fullautotrading, if in the previous example the timeframe is set to say 1 year between the two measurements, then from that information can you compute the percent number per quarter? Ie. p_quarterly used over 4 quarters should give the annual result. How much do you get for p_quarterly?
    My method gives these results, where n means the number of the periods between the two measurement points in time:
    startcap=-200 endcap=-100 :
    n=1.00 --> p=100 %
    n=4.00 --> p=18.920712 %
     
    #41     May 28, 2022
  2. easymon1

    easymon1

    Why not take your answer from an expert in the field?
    What's the name of the company paying you for this programming effort?

    Robert Morse Sponsor
    I can put you InTouch with the head of risk at STT. He is also the head of risk at Lightspeed. Just email me your contact info and a brief description I can forward to him.

    Keep us posted y'hear? lol
     
    #42     May 28, 2022
  3. lol, Sure, why not ask also Terence Tao and Andrew Wiles about this hard "Millennium" problem :)


    > "My method"

    >And: I wonder if there exist a math formula that covers all cases (incl. negative values) of such percent calculations.
    The page(s) about "percentage" at Wikipedia don't even mention any negative numbers, so they were useless in this case. :-(


    So we gather you have invented a "new" original method to define the "relative change" with respect to a given reference point. The standard definition you can find on Wikipedia (valid of any x) of course would not do for you:

    https://en.wikipedia.org/wiki/Relative_change_and_difference :

    " [​IMG] "

    (with x_reference different from 0)

    Would you care to describe your new "invention", and the reason why one would need it over the standard definition?

    If you implement a new definition of relative/ percentage change in a program, you will need to explain to the users how it works, the meaning and the motivation. Or they may even arrive to suspect that you skipped elementary school classes and are struggling with most basic arithmetics :)


    > How much do you get for p_quarterly?

    The definition holds for any x real. So you can select x wherever you want on the real line (for instance, after k "quarters", k=0,1,2,3,4).

    If you mean that x is not known within (or beyond) two distinct given points, one of which (different from 0) is taken to be a "reference", it can be interpolated, clearly based on arbitrary assumptions (linearity, interest rate, discrete or continuous, etc., or any other justifiable curve "joining", or "extending from", the 2 endpoints).
     
    Last edited: May 28, 2022
    #43     May 28, 2022
    vanzandt likes this.
  4. @fullautotrading, you have posted a formula, but w/o using it with input numbers. So, what do you get as result?

    I mean the periodic compounding formula (compound interest --> https://en.wikipedia.org/wiki/Compound_interest#Periodic_compounding )
    solved for all it its constituents (ie. endcap, startcap, r etc.), but that also can be used
    with negative startcap and negative endcap as was shown in the previous postings as well in the initial posting.
    PS: I mean the periodic compounding variant, not the continuous compounding variant in the above link.

    Never mind, I'm done.
    Beam me up, Scotty, no intelligent life here :)
     
    #44     May 28, 2022
  5. lol, too much of Star Trek :)

    Post a proper question on another thread, Captain Kirk! :)

    What you are asking now (if that is a question) is not really understandable :)

    Aren't you a programmer ? Time to fire up that C# compiler! :)
     
    #45     May 28, 2022
  6. That is not "continuous compounding". It's just under the assumption of linearity of growth (sometimes called "simple").

    With "periodic" compounding at a fixed rate you would have (compared to linear):

    Code:
    C_REF         -200
    C_CURR        -100
    INTEREST_RATE -0.16  (reduce debt)
    
            Linear      cmp     Linear%ch  cmp%change    
    Start  -200.00    -200.00     0.00%      0.00%  
    Q1     -175.00    -168.18    12.50%     15.91%
    Q2     -150.00    -141.42    25.00%     29.29%
    Q3     -125.00    -118.92    37.50%     40.54%
    End    -100.00    -100.00    50.00%     50.00%
    
     
    #46     May 28, 2022
  7. Last edited: May 28, 2022
    #47     May 28, 2022
  8. Baozi

    Baozi

    lol umbelievable this thread went on for so long.. why dont you simply download some pre-made libraries with math functions from a reputable source, input the numbers and see what comes out?
     
    #48     May 28, 2022
  9. Which library do you mean handles also such negative numbers of startcapital and endcapital?
     
    #49     May 29, 2022
  10. There is no "special" handling for negative numbers. Because all these elementary calculations work just fine with any real number (positive or negative).

    One has just to understand and use the correct "general" formulas (not the "reduced" special case, valid for positive numbers only, that were sketched in some of the posts above). These are all on Wikipedia.

    Note, in particular, that the use of abs() or the sign() function is missing in the posts above. Also, this is quite basic stuff. One has no real need for pre-made libraries.

    The arithmetic involved is the same as positive numbers (just the sign is reversed). Like (-1) - (-2) = 1 and (1) - (2) = -1.
     
    #50     May 29, 2022