Skip to content

Instantly share code, notes, and snippets.

View thertrader's full-sized avatar

The R Trader thertrader

View GitHub Profile
@thertrader
thertrader / performanceReportREADME.txt
Last active December 7, 2021 05:19
Trading Strategies Performance Report with R and Knitr
###############################################################################
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
@thertrader
thertrader / quandlDataQuality.R
Last active July 25, 2017 15:39
Evaluating Quandl Data Quality
#######################################################
# Evaluating Quandl Data Quality
#
# [email protected] - Nov 2013
#######################################################
library(quantmod)
library(Quandl)
library(Rbbg)
library(XML)
@thertrader
thertrader / geneticAlgorithms
Created March 12, 2014 15:39
Using Genetic Algorithms in Quantitative Trading
############################################################
## Using Genetic Algorithms in Quantitative Trading
##
## [email protected] - Mar 2014
############################################################
library(PerformanceAnalytics)
library(rgenoud)
library(quantmod)
library(TTR)
@thertrader
thertrader / ShinyForTradingStrategy.txt
Last active June 17, 2023 15:59
A Simple Shiny App for Monitoring Trading Strategies
This Shiny application is designed to help analysing trading strategies. It is an ongoing project that I improve when time allows. Feel free to get in touch should you have any suggestion.
*How to use the App as it is?
The App uses as input several csv files (one for each strategy). Each file has two columns: date and daily return. There is an example of such a file in the Github repository. The code is essentially made of 3 files.
-ui.R: controls the layout and appearance of the app
-server.R: contains the instructions needed to build the app. You can load as much strategies as you want as long as the corresponding csv file has the right format (see below).
-shinyStrategyGeneral.R: loads the required packages and launches the app
put ui.R and server.R file in a separate directory
In the server.R file change the inputPath, inputFile and keepColumns parameters to match your setting. The first two are self explanatory the third one is a list of column names within the csv file. Keep only date and daily return