================================================================================
  MOVING AVERAGES AND CROSSOVER
  Didactic Python code · Kardex Tauro · kardex-tauro.muisca.co
================================================================================
================================================================================
  NOTICE: educational material, not a buy or sell recommendation. The sample
  prices are invented and a past result guarantees nothing. Before investing,
  ask a licensed professional.
================================================================================

Days read (datos/prices.csv): 180
Source:
  CoinGecko, api.coingecko.com and the Federal Reserve of St. Louis (SP500
  series), downloaded on 2026-09-25. In this piece the price file is invented:
  it is there to practise the maths.

===============================================
LAST DAYS (10)
===============================================
Date              Close  20-day avg  50-day avg
-----------------------------------------------
2026-06-21       120.85      120.12      115.92
2026-06-22       116.96      119.99      116.22
2026-06-23       118.49      119.76      116.53
2026-06-24       116.43      119.40      116.76
2026-06-25       117.39      119.13      117.00
2026-06-26       115.28      118.76      117.19
2026-06-27       115.53      118.42      117.37
2026-06-28       117.18      118.17      117.56
2026-06-29       116.97      118.11      117.75
2026-06-30       117.24      118.09      117.93
-----------------------------------------------
  Reading it: the 20-day average is the short one (it reacts fast) and the
  50-day average is the long one (it shows the trend).

===========================================================
SIGNALS FOUND: 2
===========================================================
Signal      Date              Close  20-day avg  50-day avg
-----------------------------------------------------------
Sell        2026-03-16        97.97      107.93      107.95
Buy         2026-04-29       100.66       97.91       97.76
-----------------------------------------------------------
  Crossing up: the short one moves above the long one (buy signal). Crossing
  down: the short one moves below it (sell signal).

================================================================================
SIGNALS VERSUS BUY AND HOLD
================================================================================
  Starting capital: 1,000.00
  Buy and hold enters on: 2026-03-16 at a price of 97.97
  Trades of the signal strategy: 1
    2026-04-29  Buy      100.66
  Final capital following the signals: 1,164.71 (16.47 %)
  Final capital buying and holding: 1,196.69 (19.67 %)
  Buy and hold WON, by: 31.98
  Honest note: the winner depends on the stretch you measure and on the first
  signal; with other prices the other way may win. A past result guarantees
  nothing.

================================================================================
CHECKS
================================================================================
  average of the last 20 closes = value in the table: TIES
  number of crossings counted = number of signal rows: TIES

Files written
  salida/medias.csv
  salida/senales.csv

================================================================================
  NOTICE: educational material, not a buy or sell recommendation. The sample
  prices are invented and a past result guarantees nothing. Before investing,
  ask a licensed professional.
================================================================================
