Most viewed recipes tagged "optimise"http://code.activestate.com/recipes/tags/optimise/views/2014-04-28T08:41:49-07:00ActiveState Code RecipesMonte Carlo Engine : How to find the optimised wager for next bet, following a recent loss. (Python)
2014-04-28T08:41:49-07:00alexander bakerhttp://code.activestate.com/recipes/users/4166679/http://code.activestate.com/recipes/578869-monte-carlo-engine-how-to-find-the-optimised-wager/
<p style="color: grey">
Python
recipe 578869
by <a href="/recipes/users/4166679/">alexander baker</a>
(<a href="/recipes/tags/finance/">finance</a>, <a href="/recipes/tags/optimise/">optimise</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/tree/">tree</a>).
</p>
<p>Simple Engine to help understand how to best wager your next bet, given that you just made a loss. The engine uses the modified Powell method to optimise the weight to apply to your wager on the next position.</p>
<p>{'My Simple Heads And Tails Model': <BackTest.Simulation object at 0x0583D410>}
participants [100] survivors [90.0%] losers [10.0%] weight [0.073858]
solving for r: [ 0.07385806]
simulations 100, trials 100 starting pot 1000
calling initialise
{'My Simple Heads And Tails Model': <BackTest.Simulation object at 0x0583D430>}
participants [100] survivors [86.0%] losers [14.0%] weight [0.072220]
solving for r: [ 0.07221954]
Optimization terminated successfully.
Current function value: 8.000000
Iterations: 2
Function evaluations: 30
highest survivability following loss, multiply wager by 7.2949 %</p>
<h5 id="">.</h5>
<p>Ran 2 tests in 25.545s</p>
<p>OK</p>