<commit_before># InvestSim

A simple tool to simulate stock market returns using S&P 500 data from January 1871 through today

# Usage

1. Load libraries:

  $LOAD_PATH << File.join(File.dirname(__FILE__), "..", "lib")
  $LOAD_PATH << File.join(File.dirname(__FILE__), "..", "data")
  require 'investsim'

2. Parse data from <NAME>'s S&P 500 spreadsheet:

  data_table = ShillerParser.new.data_table

3. Create an investment account; optionally load with an initial investment:

  account = InvestmentAccount.new(data_table, {amount: 100})

4. Manipulate the account through investment, withdrawal, or no action through each month

  account.invest_and_advance 10
  account.withdraw_and_advance 10
  account.advance
  account.advance_to account.last_date

5. Check account balance at any point

  puts account.balance

# Current Scripts

`scripts/trinity_extended` analyzes stock market portfolio success probabilities for different drawdown terms and withdrawal rates. The script also provides for optional adjustable expense ratio and toggling between monthly and annual withdrawals

# Contributing
<commit_msg>fix code render<commit_after># InvestSim

A simple tool to simulate stock market returns using S&P 500 data from January 1871 through today

# Usage

1. Load libraries:


    $LOAD_PATH << File.join(File.dirname(__FILE__), "..", "lib")
    $LOAD_PATH << File.join(File.dirname(__FILE__), "..", "data")
    require 'investsim'

2. Parse data from <NAME>'s S&P 500 spreadsheet:


    data_table = ShillerParser.new.data_table

3. Create an investment account; optionally load with an initial investment:


    account = InvestmentAccount.new(data_table, {amount: 100})

4. Manipulate the account through investment, withdrawal, or no action through each month


    account.invest_and_advance 10
    account.withdraw_and_advance 10
    account.advance
    account.advance_to account.last_date

5. Check account balance at any point


    puts account.balance

# Current Scripts

`scripts/trinity_extended` analyzes stock market portfolio success probabilities for different drawdown terms and withdrawal rates. The script also provides for optional adjustable expense ratio and toggling between monthly and annual withdrawals

# Contributing

{'fraction_non_alphanumeric': 0.07101642254771416, 'fraction_numerical': 0.019529516200621395, 'mean_word_length': 4.635, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '579827', 'n_tokens_mistral': 668, 'n_tokens_neox': 602, 'n_words': 238}