Ad
  • Default User Avatar

    What Kata is this a duplicate of? Is it maybe "Equal to 24"? In this case, this Kata would not be an exact duplicate, since here parentheses are not allowed here whereas they are in "Equal to 24". Hence, this could be considered an easier version of "Equal to 24".

  • Default User Avatar

    I tried solving the Kata, not knowing that it is a duplicate. Just wanted to let you know that I could solve, so your description is clear and everything works. Looking forward to your next Kata!

  • Default User Avatar

    @uttumuttu's second suggestion to describe VAR was helfpul for me: "The simplest explanation (of VAR) is that each equity's total shifts are obtained as the relative shifts of its currency-converted price series." I enjoyed the kata because it not only allowed me to practice Python but also to learn about VAR.

  • Default User Avatar

    Hi Marty,
    this was very helpful, thank you. My solution now passes all the description related tests and most of the random larger tests. The output I am getting for the failed tests is "False should equal True", which does not help me in finding my error(s). Would it be possible to change this to something like: "get_var is returning incorrect value: 96.02 should equal 104.89"?

  • Default User Avatar

    I could solve my problem with rounding: I rounded past relative shifts to 6 digits because you wrote you rounded them to 6 digits (for better readability). I can pass the tests if I don't round.

    I am still struggling with how VAR is calculated, except for the simple cases where only one equity is involved.

    @Marty3000: I cannot see your comment, you seem to have hidden it.

  • Default User Avatar

    I am having two issues:

    (1) I seem to have a problem with rounding, as I am getting this error message in the tests: "1-Day Equity Value at Risk for your 100 MartyCorp - Equities and a confidence level of 0.90 is 206.54 USD: 206.53 should equal 206.54"

    (2) It's not clear to me how to calculate total VAR for equtiy and foreign exchange risk. For each day I calculate the value shift due to the change in equity rates and the change in foreign exchange rate and I then add the two amounts.
    I am enjoying this kata and would appreciate a hint so that I can finish it.