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
#' calculate trade statistics for round turn trades. | |
#' | |
#' One 'trade' is defined as a series of transactions which make up a 'round turn'. | |
#' It may contain many transactions. This function reports statistics on these | |
#' round turn trades which may be used on their own or which are also used | |
#' by other functions, including \code{\link{tradeStats}} and \code{\link{tradeQuantiles}} | |
#' | |
#' @details | |
#' Additional methods of determining 'round turns' are also supported. | |
#' |
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$ |
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
--- | |
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
#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; |
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
# 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 | |
############################################################################### |
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
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
# 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') |