Skip to content

Instantly share code, notes, and snippets.

View tomas-rampas's full-sized avatar
💻
CMaking...

Tomas Rampas tomas-rampas

💻
CMaking...
  • Prague, Czech Republic
  • 10:19 (UTC +02:00)
View GitHub Profile
@tomas-rampas
tomas-rampas / app.config
Created November 10, 2014 07:27
Proxying WCF service
<!--
Part of WCF application host config file
WCF communication is proxying via locahost:8888
-->
<system.net>
<defaultProxy enabled = "true" useDefaultCredentials = "true">
<proxy autoDetect="false" bypassonlocal="false" proxyaddress="http://127.0.0.1:8888" usesystemdefault="false" />
</defaultProxy>
</system.net>
# Donchian Channel
def donchian(df, n):
i = df.index[-1] - 1
dcuarr = [float('NaN')] * df.index[-1]
dclarr = [float('NaN')] * df.index[-1]
while i - n >= 0:
dcupper = max(df['High'].ix[i - n:i])
dclower = min(df['Low'].ix[i-n:i])
dcuarr[i] = dcupper
@tomas-rampas
tomas-rampas / corr.r
Last active November 8, 2015 20:25
Correlation Sample
require(chron)
require(Hmisc)
require(ggplot2)
#this function creates and returns date time for indexing purposes later
f = function(d, t) as.chron(paste(strptime(d, "%Y.%m.%d"), t))
#path to data, change for pointing your repository
path <- "G://TickData//"
#suffix of the file names with extension
suffix <- "_UTC+0_00_noweekends_fxmtf.csv"
library(quantmod)
library(zoo)
library(chron)
#following section loads "Systematic Investor Toolbox"
setInternet2(TRUE)
con <- gzcon(url('https://github.com/systematicinvestor/SIT/raw/master/sit.gz', 'rb'))
source(con)
close(con)
#required libraries
library(quantmod)
library(zoo)
library(chron)
#following section loads "Systematic Investor Toolbox"
setInternet2(TRUE)
con <- gzcon(url('https://github.com/systematicinvestor/SIT/raw/master/sit.gz', 'rb'))
source(con)
close(con)
/**
* Created by Tomas Rampas on 4/10/2016.
*/
import com.dukascopy.api.*;
import com.dukascopy.api.drawings.*;
import com.dukascopy.api.feed.IFeedDescriptor;
import com.dukascopy.api.indicators.*;
import java.awt.*;
#reads ticks and creates .rda file
library(xts)
library(zoo)
library(blotter)
symbol = "GBPJPY"
tick.data.dir <- paste0('g:\\JForex\\data\\', symbol)
tick.data.outdir <- "g:\\TickData\\"
rm(list = ls())
gc()
library(knitr)
library(blotter)
if (!exists('.blotter')) .blotter <- new.env()
suppressWarnings(try(rm(list=c("account.forex","portfolio.forex"),pos=.blotter),silent=TRUE))
suppressWarnings(try(rm(list=c("b.strategy","myTheme","EURUSD",".getSymbols")),silent=TRUE))
# this gist anticipates following:
# existence of GBPJPY.csv with OHLC series in g:\TickData directory
# time series having date time in format %d.%m.%Y %H:%M:%S
# update above assumptions in accordance with your dataset
library(blotter)
symbol = "GBPJPY"
import com.dukascopy.api.*;
import org.rosuda.JRI.REXP;
import org.rosuda.JRI.Rengine;
/**
* Created by tomas on 8/17/2016.
*/
public class JRITestStrategy implements IStrategy {
@Override