Skip to content

Instantly share code, notes, and snippets.

View Schellinkhoutkamp's full-sized avatar

Stijlie Schellinkhoutkamp

View GitHub Profile
@Schellinkhoutkamp
Schellinkhoutkamp / goalgo
Last active April 14, 2019 08:40
Jared algos
func testing(t int, xc[]float64)float64{
//rs := float64(0)
totalGain := float64(0)
totalLoss := float64(0)
if len(xc) > t {
xc = xc[0:t]
}
for i := 1; i < len(xc); i++ {
previous := xc[i]
current := xc[i-1]
@Schellinkhoutkamp
Schellinkhoutkamp / main
Created April 5, 2019 12:10
Jared algos
import (
"context"
"fmt"
"math"
"strconv"
"time"
"github.com/adshao/go-binance"
)
@Schellinkhoutkamp
Schellinkhoutkamp / goalgo
Created April 5, 2019 12:07
Jared algos
import(
"math"
)
func rc(t int, x []float64) float64 {
if len(x)-2 < t {
return 0
}
s := float64(0)
for j := 0; j < t; j++ {
func rc(t int, x []float64) float64 {
if len(x)-2 < t {
return 0
}
s := float64(0)
for j := 0; j < t; j++ {
s += x[j] - x[j+1]
}
return (s / float64(t))
}
func rc(t int, x []float64) float64 {
if len(x)-2 < t {
return 0
}
s := float64(0)
for j := 0; j < t; j++ {
s += x[j] - x[j+1]
}
return (s / float64(t))
}
// TRADES ON DROP REBOUNDS TOM 20-1
index = BNCE_XBTUSD;
magnTresh = index[0]/500 // start trading from this drop magnitude
magnSpeed = magnTresh/100 // minimal consistent change per second
function rc(t, x){
x = x.slice(0,t+1); s = 0;
for(j=0;j<x.length-1;j++){
s += x[j]-x[j+1];
// BREAKOUT CLEAN
function sma(t, xc){
som=0; xc=xc.slice(0,t);
for(i=0;i<xc.length;i++){som+=xc[i];}
return som/xc.length;
}
function pricemove (t, xc){
//xc=xc.slice(0,150);
// BREAKOUT CLEAN MAC
function sma(t, xc){
som=0; xc=xc.slice(0,t);
for(i=0;i<xc.length;i++){som+=xc[i];}
return som/xc.length;
}
function pricemove (t, xc){
return xc[0]-xc[t];
@Schellinkhoutkamp
Schellinkhoutkamp / BREAKOUT CLEAN
Last active January 20, 2019 12:09
Jared algos
// BREAKOUT CLEAN
function sma(t, xc){
som=0; xc=xc.slice(0,t);
for(i=0;i<xc.length;i++){som+=xc[i];}
return som/xc.length;
}
function pricemove (t, xc){
return xc[0]-xc[t];
// BREAKOUT CLEAN
function sma(t, xc){
som=0; xc=xc.slice(0,t);
for(i=0;i<xc.length;i++){som+=xc[i];}
return som/xc.length;
}
function pricemove (t, xc){
return xc[0]-xc[t];