Skip to content

Instantly share code, notes, and snippets.

@jtwyles
jtwyles / dema.py
Last active August 19, 2023 18:23
Calculate EMA(EMA) and DEMA in Python
#
# See how to use this script and what type of input to use at:
# https://steemit.com/trading/@jwyles/ema-ema-and-dema-how-to-calculate-using-python-and-spreadsheets
#
# This gist is an extension of this other gist:
# https://gist.github.com/jtwyles/517becb2deebf9e3b2874d8c26c4c99f
#
import csv
import re
@jtwyles
jtwyles / ma.py
Last active April 27, 2023 06:18
Calculate SMA and EMA in Python
#
# See how to use this script and what type of input to use at:
# https://steemit.com/cryptocurrency/@jwyles/moving-averages-sma-ema-how-to-use-and-how-to-calculate-with-spreadsheet-and-code-snippets
#
import csv
import re
from functools import reduce
from dateutil import parser