This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def exponentialMovingAverage(period, data): | |
#--- Exponential Moving Average | |
# data: array, time series data e.g. daily close prices | |
# period: integer, number of periods form time series array to include in calculation | |
#--- import libraries | |
import numpy as np | |
#--- get first non nan index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dos2unix -n /tmp/target_file.txt /tmp/tmp.txt | |
mv -f /tmp/tmp.txt /tmp/target_file.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
CASE | |
WHEN length( | |
translate('testing123£$%^4521 with ch*(ars HELP TEST THIS', | |
' 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', | |
'' | |
) | |
) > 0 | |
THEN TRUE | |
ELSE FALSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def simpleMovingAverage(period, data): | |
# --- Simple Moving Average | |
# data: array, time series data e.g. daily close prices | |
# period: integer, number of periods form time series array to include in calculation | |
# --- import libraries | |
import numpy as np | |
# --- get first non nan index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def t3MovingAverage(period,data,vfactor=0.7,tcount=3): | |
#--- T3 Moving Average | |
# data: array, time series data e.g. daily close prices. | |
# period: integer, number of periods form time series array to include in calculation. | |
# vfactor: float, number between 1 and 0. 1 = DEMA, 0 = EMA. default 0.7. | |
# tcount: integer, number 1 or greater. times the data is smoothed with the generalisedDEMA. default 3 (T3). | |
# | |
# requires numpy and techind libraries | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def mesaAdaptiveMovingAverage(high, low, fastLimit, slowLimit, warmUpPeriod): | |
# --- MESA Adaptive Moving Average | |
# high: array, time series data e.g. daily close prices | |
# low: array, time series data e.g. daily close prices | |
# period: integer, number of periods from time series array to include in calculation | |
# | |
# converted from sources: | |
# https://www.mesasoftware.com/papers/MAMA.pdf | |
# https://www.quantconnect.com/forum/discussion/942/john-ehlers-mama-and-frama-indicators/p1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
'testing1234521 with chars x2' as original_string, | |
trim( | |
translate( | |
original_string, | |
translate( | |
original_string, | |
'1234567890', | |
'' | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private Function createDIR(dir As String) As Boolean | |
'--- Create Directory (recursivley) | |
' excel vba code to take string input as path and recursivley create | |
' folders if not exists. windows only. | |
' | |
' dir: full path to directory you want created (string) | |
'--- setup | |
createDIR = False |
NewerOlder