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
#!/usr/bin/env bash | |
# Download ta-lib-0.4.0-src.tar.gz and: | |
if [[ ! -f "ta-lib-0.4.0-src.tar.gz" ]]; then | |
wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz | |
fi | |
# untar and cd | |
if [[ ! -d "ta-lib" ]]; then | |
tar xvf ta-lib-0.4.0-src.tar.gz | |
fi |
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
#!/usr/bin/env python | |
# Download xml and parse it into org mode for reading | |
# Requires the full content to be in the RSS feed | |
import argparse | |
from lxml import etree | |
import logging | |
import os | |
import requests | |
import subprocess | |
import sys |
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
# Extended python -m http.serve with --username and --password parameters for | |
# basic auth, based on https://gist.github.com/fxsjy/5465353 | |
# Usage: python -m http_server_auth -u USERNAME -p PASSWORD -d . | |
from functools import partial | |
from http.server import SimpleHTTPRequestHandler, test | |
import base64 | |
import os | |
class AuthHTTPRequestHandler(SimpleHTTPRequestHandler): |
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 apply_pt_sl_on_t1(close, events, pt_sl, molecule): # pragma: no cover | |
""" | |
Snippet 3.2, page 45, Triple Barrier Labeling Method | |
This function applies the triple-barrier labeling method. It works on a set of | |
datetime index values (molecule). This allows the program to parallelize the processing. | |
Mainly it returns a DataFrame of timestamps regarding the time when the first barriers were reached. | |
:param close: (series) close prices |
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
#!/usr/bin/env bash | |
# https://lightgbm.readthedocs.io/en/latest/Installation-Guide.html#macos | |
# Mac Mojave, using Apple Clang | |
set -e | |
info () { | |
printf " [ \033[00;34m..\033[0m ] $1\n" | |
} |
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
from qtpylib.algo import Algo | |
from qtpylib import futures | |
class DebugPosition(Algo): | |
def on_start(self): | |
self.counter = 0 | |
self.counter_at_entry = 0 | |
def on_fill(self, instrument, order): |
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
;; easylanguage mode | |
;; https://www.emacswiki.org/emacs/GenericMode | |
;; too many members for the default specpdlsize | |
;; still missing some options, processed via | |
;; #!/bin/sh | |
;; cat $1 | awk '{ print $1 }' | tr -d ";" | grep = | cut -f1 -d= | sort -u | while read x; do echo -n "\"$x\" "; done | |
(setq max-specpdl-size 6000) | |
(define-generic-mode 'easylanguage-mode | |
;; comments |
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
# Find dir | |
# https://stackoverflow.com/questions/2824504/how-do-i-prevent-find-from-printing-git-folders | |
function finddir () { | |
# Defaults | |
DEPTH=4 | |
# Arg check | |
if [ "$#" -gt 2 ] || [ "$#" -lt 1 ] ; then | |
echo "Illegal number of parameters" | |
fi |
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
(defun user--save-macro (name) | |
"Save a macro. Take a name as an argument and save the last defined macro under this name." | |
(interactive "SName of the macro :") | |
(kmacro-name-last-macro name) | |
(find-file "~/.emacs.d/macros.el") | |
(goto-char (point-max)) | |
(newline) | |
(insert-kbd-macro name) | |
(newline) | |
(save-buffer) |
NewerOlder