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
# Python 3 code | |
import matplotlib.pyplot as mpl | |
import scipy.cluster.hierarchy as sch,random | |
import numpy as np | |
import pandas as pd | |
# Now, take corMat and covMat generated from R, input into Marcos' Python, and check output is the same... | |
col_list = ["IGV.Close", "TLT.Close", "IAU.Close", "IYR.Close"] | |
corr = pd.read_csv("corMat_23072021.csv", usecols=col_list) |
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
# R code | |
corMat <- read.csv("corMat_23072021.csv")[,-1] | |
covMat <- read.csv("covMat_23072021.csv")[,-1] | |
clustOrder <- hclust(dist(corMat), method = 'single')$order | |
clustOrder | |
# Plot Dendogram for some visualization of the order | |
clust <- hclust(dist(corMat), method = 'single') |
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
name: R-CMD-check | |
on: | |
- push | |
- pull_request | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: |
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
--- | |
title: "Jane_Street_Kaggle" | |
author: "Jasen Mackie" | |
date: "18/12/2020" | |
output: html_document | |
--- | |
```{r setup, include=FALSE} | |
require(data.table) | |
require(ggplot2) |
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
# Simple MACD signal strategy | |
# | |
# blotter v 0.10.0 | |
# quantstrat v 0.9.1739 | |
# FinancialInstrument v 1.2.0 | |
# Rblpapi v 0.3.4 | |
# | |
# | |
# Author: Jasen | |
############################################################################### |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#include "math.h" | |
#include "stdio.h" | |
double AttackerSuccessProbability(double q, int z) | |
{ | |
double p = 1.0 - q; | |
double lambda = z * (q / p); | |
double sum = 1.0; | |
int i; | |
int k; |
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
--- | |
title: A replication of the Practical Application section in 'The Probability of Backtest | |
Overfitting' - Bailey et al. | |
output: | |
html_notebook: | |
# html_document: | |
# df_print: paged | |
--- | |
In their paper "The Probability of Backtest |
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
require(blotter) | |
# Remove portfolio and account data if run previously | |
try(rm("portfolio.txnsim_rnorm_port","account.txnsim_rnorm_acct",pos=.blotter), silent = TRUE) | |
# load the example data | |
currency("USD") | |
stock("GSPC",currency="USD",multiplier=1) | |
getSymbols('^GSPC', src='yahoo', index.class=c("POSIXt","POSIXct"),from='1998-01-01') |
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
############################################################################### | |
# R (http://r-project.org/) Quantitative Strategy Model Framework | |
# | |
# Copyright (c) 2009-2017 | |
# Peter Carl, Dirk Eddelbuettel, Brian G. Peterson, Jeffrey Ryan, and Joshua Ulrich | |
# | |
# This library is distributed under the terms of the GNU Public License (GPL) | |
# for full details see the file COPYING | |
# | |
# $Id$ |
NewerOlder