How is luck calculated

I love the luck percentage at the top, but can't figure out how it calculates your luck. I ran a test game with 50% odds of winning:

  • Won - blank

  • Lost - 100%
  • Lost - 50%
  • Lost - 33%
  • Lost - 25%
  • Won - 50%
  • Won - 75%
  • Won - 100%
  • Lost - 80%
  • Lost - 66.67%
  • Lost - 57.14%
  • Lost - 50%
  • Lost - 44.44%
  • Lost - 40%
  • Won - 50%

Can someone shed some light on the math magic at work here?

it's pretty simple --- let''s say you roll 100 times on 99x and hit on your 100th bet, you'd have 100% 'luck', if you rolled 101 and hit on your last bet, you'd have 99% luck etc