Colors borrowed from bitcoin wisdom, but chart engine is custom and using SVG instead of Canvas.
This file contains hidden or 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
| import pandas as pd | |
| import numpy as np | |
| # names for the asset selection | |
| NAMES = ['6M_Momentum', '1Y_Momentum', '6M_LowVol'] | |
| # allocation algorithm names (equally weighted) | |
| ALLOCATION = ['EW'] | |
| class Backtest: |
A zoomable candlestick chart.
Copyright © 2015, Anil Nair - MIT License
This file contains hidden or 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
| import matplotlib.pyplot as plt | |
| from datetime import datetime | |
| import alpaca_trade_api as tradeapi | |
| import numpy as np | |
| from positionhandling import positionHandler | |
| import loader | |
| api = tradeapi.REST() |
This file contains hidden or 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
| #!/bin/sh | |
| if [ "$PYENV_VERSION" -ne "" ] | |
| then | |
| name=`pyenv version-name` | |
| python=`pyenv which python` | |
| else | |
| name=`basename "$VIRTUAL_ENV"` | |
| python="$VIRTUALENV/bin/python" | |
| fi |
This file contains hidden or 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
| function slugify(string) { | |
| const a = 'àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;' | |
| const b = 'aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------' | |
| const p = new RegExp(a.split('').join('|'), 'g') | |
| return string.toString().toLowerCase() | |
| .replace(/\s+/g, '-') // Replace spaces with - | |
| .replace(p, c => b.charAt(a.indexOf(c))) // Replace special characters | |
| .replace(/&/g, '-and-') // Replace & with 'and' | |
| .replace(/[^\w\-]+/g, '') // Remove all non-word characters |
This file contains hidden or 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
| //var csv is the CSV contents with headers | |
| function csvJSON(csv){ | |
| var lines=csv.split('\n'); | |
| var result = []; | |
| var headers=lines[0].split(','); | |
| lines.splice(0, 1); | |
| lines.forEach(function(line) { |
This file contains hidden or 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
| // NTP_System_Time.ino | |
| //schufti --of ESP8266.com Forum provided source for NTP time. | |
| //Developer of code not given | |
| #include <WiFi.h> | |
| #include <WiFiUdp.h> | |
| #include <sys/time.h> | |
| #include <time.h> |
OlderNewer