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:16 (UTC +02:00)
View GitHub Profile
@ih2502mk
ih2502mk / list.md
Last active May 3, 2024 08:25
Quantopian Lectures Saved
@bigsnarfdude
bigsnarfdude / two_sigma_kalman_rolling.py
Last active April 7, 2023 10:37
using kalman filter for rolling window instead of average for faster convergence esp 2 sigma
# https://scipy-cookbook.readthedocs.io/items/KalmanFiltering.html
# https://github.com/pykalman/pykalman
import pandas as pd
from pykalman import KalmanFilter
import numpy as np
def rolling_window(a, step):
shape = a.shape[:-1] + (a.shape[-1] - step + 1, step)
strides = a.strides + (a.strides[-1],)
@ang-st
ang-st / tv.js
Created May 17, 2017 10:04
Trading view data
var util=require('util')
var WebSocketClient = require('websocket').client;
var client = new WebSocketClient();
var conn = null
var received = false
client.on('connectFailed', function(error) {
console.log('Connect Error: ' + error.toString());
});
@hnykda
hnykda / keras_prediction.py
Last active August 21, 2020 01:33
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
@lukehorvat
lukehorvat / excel-grid-plugin.js
Last active March 8, 2019 16:08
An Ext JS 4 grid plugin that provides Microsoft Excel-esque cell navigation and editing via keyboard. (License: MIT License)
var newGridCellValue = '',
deleteGridCellValue = false;
Ext.define('ExcelCellEditing', {
extend: 'Ext.grid.plugin.CellEditing',
alias: 'plugin.excelcellediting',
initEditTriggers: function () {
var me = this;
@tristanwietsma
tristanwietsma / mercsettles.py
Created April 30, 2013 02:15
CME settlement price fetcher Ugly, but effective, script for getting CME settlement prices off their FTP side. Could use a clean up...
import sys, string, urllib
GROUPS = dict([('ags','ftp://ftp.cmegroup.com/pub/settle/stlags'),
('rates','ftp://ftp.cmegroup.com/pub/settle/stlint'),
('fx','ftp://ftp.cmegroup.com/pub/settle/stlcur'),
('nymex','ftp://ftp.cmegroup.com/pub/settle/stlnymex'),
('comex','ftp://ftp.cmegroup.com/settle/stlcomex'),
('clearport','ftp://ftp.cmegroup.com/settle/stlcpc')])
# month codes
@ivannp
ivannp / e1071.R
Created December 1, 2012 03:18
Back-testing SVM with e1071
svmComputeOneForecast = function(
id,
data,
response,
startPoints,
endPoints,
len,
history=500,
trace=FALSE,
kernel="radial",
"""
jQuery templates use constructs like:
{{if condition}} print something{{/if}}
This, of course, completely screws up Django templates,
because Django thinks {{ and }} mean something.
Wrap {% verbatim %} and {% endverbatim %} around those
blocks of jQuery templates and this will try its best