Skip to content

Instantly share code, notes, and snippets.

Avatar

The R Trader thertrader

View GitHub Profile
@thertrader
thertrader / ShinyForTradingStrategy.txt
Last active Nov 21, 2021
A Simple Shiny App for Monitoring Trading Strategies
View ShinyForTradingStrategy.txt
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
@thertrader
thertrader / geneticAlgorithms
Created Mar 12, 2014
Using Genetic Algorithms in Quantitative Trading
View geneticAlgorithms
############################################################
## Using Genetic Algorithms in Quantitative Trading
##
## thertrader@gmail.com - Mar 2014
############################################################
library(PerformanceAnalytics)
library(rgenoud)
library(quantmod)
library(TTR)
@thertrader
thertrader / quandlDataQuality.R
Last active Jul 25, 2017
Evaluating Quandl Data Quality
View quandlDataQuality.R
#######################################################
# Evaluating Quandl Data Quality
#
# thertrader@gmail.com - Nov 2013
#######################################################
library(quantmod)
library(Quandl)
library(Rbbg)
library(XML)
@thertrader
thertrader / performanceReportREADME.txt
Last active Dec 7, 2021
Trading Strategies Performance Report with R and Knitr
View performanceReportREADME.txt
###############################################################################
# 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.