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
  • 14:48 (UTC +02:00)
View GitHub Profile
@tomas-rampas
tomas-rampas / shrimpy-request-sample.cs
Last active August 2, 2021 07:19
Shrimpy.io Signing Request Sample in C#
using System;
using System.Net.Http;
using System.Security.Cryptography;
using System.Text;
/*
* This gist shows a sample of signing a GET request for shrimpy.io
* based on Pyton sample on https://developers.shrimpy.io/docs/?python#creating-a-request
*/
#
# All credits of this source code to https://www.investingdev.com/en/statarb-in-forex/
#
########################################################################################
## Imports and set working directory ##
########################################################################################
require(tseries)
@tomas-rampas
tomas-rampas / JForexLibrariesDownloader.ps1
Last active January 1, 2018 20:08
Powershell script for downloading jForex libraries. Needs Powershell 3.0 and above.
Set-ExecutionPolicy -Scope "CurrentUser" -ExecutionPolicy "RemoteSigned"
$jforex3Jnlp = 'jforex_3.jnlp'
$baseURL = 'http://platform.dukascopy.com/demo_3/'
$sourceJnlpURL = "$baseURL$jforex3Jnlp"
$appFrameworkXPath = '//jnlp/resources/extension[@name="AppFramework"]'
$jarsXPath = '//jnlp/resources/jar'
$outFileJForex3Jnlp = "$PSScriptRoot\jforex_3.jnlp"
$outFileLibs3Jnlp = "$PSScriptRoot\libs_3.jnlp"
$localLibSubDir = "jforex3libs"
@tomas-rampas
tomas-rampas / keras_prediction.py
Created November 17, 2016 16:07 — forked from hnykda/keras_prediction.py
Predicting sequences of vectors (regression) in Keras using RNN - LSTM (danielhnyk.cz)
import pandas as pd
from random import random
flow = (list(range(1,10,1)) + list(range(10,1,-1)))*100
pdata = pd.DataFrame({"a":flow, "b":flow})
pdata.b = pdata.b.shift(9)
data = pdata.iloc[10:] * random() # some noise
import numpy as np
static void Main()
{
var server = new NamedPipeServerStream("NPtest");
Console.WriteLine("Waiting for connection...");
server.WaitForConnection();
Console.WriteLine("Connected.");
var br = new BinaryReader(server);
var bw = new BinaryWriter(server);
# coding=utf-8
import time
import struct
f = open(r'\\.\pipe\NPtest', 'r+b', 0)
i = 1
while True:
s = 'Message[{0}]'.format(i)
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
# 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"
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))
#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\\"