Description: For the OPT_PROB_INMONEY function when selected in the Function Wizard, the "put/call" and "strike" arguments have the wrong labels (they should be swapped). At the moment you can enter a "p" or "c" in the strike argument and a numeric value in the "put/call" field. Steps to Reproduce: 1.Open Function Wizard 2.Select Financial from the Category menu 3.Select OPT_PROB_INMONEY from Function menu 4.Enter "p" or "c" in put/call argument box. Note how Err502 reported in Result field of Function Wizard. 5.Repeat above but entering 80 in strike argument box Actual Results: Entering "p" or "c" in strike field is allowed. Entering 80 in "put/call" field is allowed. Expected Results: Entering "p" or "c" in strike field should not be allowed. Entering 80 in "put/call" field should not be allowed. Reproducible: Always User Profile Reset: No Additional Info:
On Win10 with master sources updated today, I could reproduce this. Taking a look at: 66 /// OPT_PROB_INMONEY(), probability of ending up in-the-money. 67 double getOptProbInMoney( [in] double spot, [in] double vol, 68 [in] double mu, [in] double maturity, 69 [in] double barrierLow, [in] double barrierUp, 70 [in] any strike, [in] any putCall ) 71 raises( com::sun::star::lang::IllegalArgumentException ); https://opengrok.libreoffice.org/xref/core/scaddins/idl/com/sun/star/sheet/addin/XPricingFunctions.idl?r=8d0dbbda#66 200 virtual double SAL_CALL getOptProbInMoney( double spot, double vol, 201 double mu, double T, 202 double barrier_low, double barrier_up, 203 const css::uno::Any& strikeval, const css::uno::Any& put_call ) override; https://opengrok.libreoffice.org/xref/core/scaddins/source/pricing/pricing.hxx?r=c4ab5781#200 There's indeed a mix between the 2 last args in the UI.
Created attachment 156184 [details] patch I'll submit this patch when get back home. If someone wants to submit it on gerrit before, don't hesitate!
Taking a look at https://cgit.freedesktop.org/libreoffice/core/commit/?id=e9f31eaa49f9494113e72deaf0fe079701844ea4, it's been the case at the beginning when the function has been implemented, if I interpret well the commit.
https://gerrit.libreoffice.org/#/c/84078
Julien Nabet committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/b1832658951d9f03c871b665b270a73deacf884f tdf#129098: parameters mixed in OPT_PROB_INMONEY (scaddins) It will be available in 6.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Cherry-picks waiting for review: - 6.4: https://gerrit.libreoffice.org/#/c/84088/ - 6.3: https://gerrit.libreoffice.org/#/c/84089/
Julien Nabet committed a patch related to this issue. It has been pushed to "libreoffice-6-3": https://git.libreoffice.org/core/commit/b414e1b9fc428279bfd4258537f0a1d2de2a343b tdf#129098: parameters mixed in OPT_PROB_INMONEY (scaddins) It will be available in 6.3.5. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Julien Nabet committed a patch related to this issue. It has been pushed to "libreoffice-6-4": https://git.libreoffice.org/core/commit/9fb18eb82c24a3dd66e12aef1082422b7c924034 tdf#129098: parameters mixed in OPT_PROB_INMONEY (scaddins) It will be available in 6.4.0.1. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.