- Distributed ledger system; for tracking the transfer of tokens (currency, data of any type).
- A cross between economics, cryptography, and the internet.
- Side note- if you ever wanted a financial incentive to get involved in cryptography, this is it.
- A blockchain is literally a chain of blocks, where each block contains a list of transactions that everyone agrees have occurred.
- Each block builds upon all the ones before it.
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
| #Code to re-create John Hussman's Recession warning index | |
| #http://www.hussmanfunds.com/wmc/wmc110801.htm | |
| #R code by Zach Mayer | |
| rm(list = ls(all = TRUE)) #CLEAR WORKSPACE | |
| library(quantmod) | |
| ################################################# | |
| # 1. Credit spreads | |
| ################################################# |
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
| # This simple script gathers data of stocks and uses it to simulate future price for | |
| # 1 year (255 days). Then it optimises the portfolio for risk and returns using risk | |
| # measures such as VaR | |
| # | |
| # Note: tickers are all lower case, such as "aapl" | |
| from scipy.special import ndtri | |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| import itertools |
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
| string VERSION = "TL BO 1.0"; | |
| extern int EXT_ATR = 300; // ATR(x) | |
| extern double EXT_ATR_INI_STOP = 0.1; // additional buffer to add beyond the initial stop | |
| extern int EXT_LOOKBACK = 3; // number of bars to find highest high/lowest low | |
| extern double EXT_RISK_MINAMT = 50; // dollar value of the minimum amount to risk per trade | |
| extern double EXT_RISK_DIVISOR = 10; // AccountBalance/X = risk per trade | |
| extern int EXT_MAX_SLIP = 10; // maximum points of slippage allowed for order 10 = 1 pip | |
| extern double EXT_ATR_TRAILSTOP = 2; // multiple for trailing the market ATR(EXT_ATR) * X |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
About Santiago:
@namessanti
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 urllib2 | |
| import json | |
| import csv | |
| import pandas as pd | |
| import numpy as np | |
| import decimal | |
| D = decimal.Decimal | |
| url = "https://www.wework.com/locations/all" | |
| data = urllib2.urlopen(url).read() |
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
| %% Ornstein-Uhlenbeck Process | |
| % ...from the paper "FLUCTUATING SYNAPTIC CONDUCTANCES RECREATE IN | |
| % VIVO-LIKE ACTIVITY IN NEOCORTICAL NEURONS" | |
| % The stochastic differential equation is given by: | |
| % dx/dt = 1/tau * (mu - x) + sqrt(D) * chi(t) | |
| % where: | |
| % x is the random variable | |
| % D is the amplitude of the stochastic component | |
| % chi(t) is a normally-distributed (zero-mean) noise source | |
| % tau is the time constant (tau = 0 gives white noise, tau > 0 gives |
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 math | |
| import numpy | |
| import random | |
| import decimal | |
| import scipy.linalg | |
| import numpy.random as nrand | |
| import matplotlib.pyplot as plt | |
| """ | |
| Note that this Gist uses the Model Parameters class found here - https://gist.github.com/StuartGordonReid/f01f479c783dd40cc21e |
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 Quandl as q | |
| import pandas as pd | |
| x = str(raw_input("Enter a symbol")) | |
| x = x.capitalize() | |
| symbol = 'SI/'+ x + '_SI' | |
| print symbol | |
| sym = q.get(symbol, authtoken="Hbkxrvo898cZ42h-VrCe") | |
| ShIn = sym["Days to Cover"] | |
| med = ShIn.median() | |
| print med |
NewerOlder

