Withdraw rate

[1]:
from mypo import Runner, Market, SamplingMethod
[2]:
market = Market.create(
    start_date="2021-01-01",
    end_date="2071-01-01",
    yearly_gain=0.00
)
market = market.resample(SamplingMethod.MONTH)
runner = Runner()

runner.run(
    market=market,
    assets=[0.0],
    cash=1.5,
    withdraw=0.06,
    verbose=True)
runner.report().history().plot()
100%|██████████| 598/598 [00:05<00:00, 119.33it/s]
[2]:
<AxesSubplot:>
../_images/tutorial_withdraw_2_2.png
[3]:
market = Market.create(
    start_date="2021-01-01",
    end_date="2071-01-01",
    yearly_gain=0.04
)
market = market.resample(SamplingMethod.MONTH)
runner = Runner()

runner.run(
    market=market,
    assets=[1.0],
    cash=0.5,
    withdraw=0.06,
    verbose=True
)
report = runner.report().history().plot()
100%|██████████| 598/598 [00:05<00:00, 118.94it/s]
../_images/tutorial_withdraw_3_1.png