Skip to content

Instantly share code, notes, and snippets.

View askmike's full-sized avatar

Mike van Rossum askmike

View GitHub Profile
@askmike
askmike / example.js
Created December 9, 2018 12:59
example on using a gekko indicator with non standard input
// Within Gekko the easiest way to use indicators is to use the addIndicator interface:
this.addIndicator('myEma', 'EMA', 10);
// However this way you have little control over what data goes into the indicator (always market data)
// If you want to put output of another indicator into your EMA you cannot use this interface and have to
// manually import the indicator that you want to feed other data, for example:
const EMA = require('./indicators/EMA');
@askmike
askmike / poloniex.js
Last active October 10, 2018 09:21
debug-polo
const crypto = require('crypto');
const nonce = require('nonce');
const querystring = require('querystring');
const https = require('https');
const version = require('./package.json').version;
const name = require('./package.json').name;
const USER_AGENT = `${name}@${version}`;
@askmike
askmike / example.js
Last active October 10, 2018 08:56
TP example in a gekko strat
strat.init = function() {
// your stuff
this.tp = false;
}
strat.check = function(candle) {
@askmike
askmike / example.js
Created October 4, 2018 04:07
expsoing this.advice in a gekko strat
// option 1:
const otherFunction = (candle, advice) => {
// your other function
// example:
if(something) {
advice('long');
}
}
start.check = (candle) => {
// whenever you call otherFunction simply pass the advice function
@askmike
askmike / v2.js
Created August 11, 2018 07:48
ema test
// This is a basic example strategy for Gekko.
// For more information on everything please refer
// to this document:
//
// https://gekko.wizb.it/docs/strategies/creating_a_strategy.html
//
// The example below is pretty bad investment advice: on every new candle there is
// a 10% chance it will recommend to change your position (to either
// long or short).
@askmike
askmike / cdl3inside.js
Last active April 13, 2019 10:15
cdl3inside example
var method = {};
// Prepare everything our method needs
method.init = function() {
this.name = 'cdl3inside'
this.input = 'candle';
this.requiredHistory = this.tradingAdvisor.historySize;
// define the candle indicator
this.addTalibIndicator('cdl', 'cdl3inside', {});
@askmike
askmike / debug.log
Created January 26, 2018 13:22
full node no routing
2018-01-23 23:30:53 Bitcoin version v0.15.1.0-g7b57bc998f
2018-01-23 23:30:53 InitParameterInteraction: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1
2018-01-23 23:30:53 Assuming ancestors of block 0000000000000000003b9ce759c2a087d52abc4266f8f4ebd6d768b89defa50a have valid signatures.
2018-01-23 23:30:53 Setting nMinimumChainWork=000000000000000000000000000000000000000000723d3581fe1bd55373540a
2018-01-23 23:30:53 Using the 'standard' SHA256 implementation
2018-01-23 23:30:53 Using RdRand as an additional entropy source
2018-01-23 23:30:53 Default data directory /root/.bitcoin
2018-01-23 23:30:53 Using data directory /root/.bitcoin
2018-01-23 23:30:53 Using config file /root/.bitcoin/bitcoin.conf
2018-01-23 23:30:53 Using at most 125 automatic connections (1024 file descriptors available)
@askmike
askmike / debug.log
Created January 26, 2018 13:22
full node no routing
2018-01-23 23:30:53 Bitcoin version v0.15.1.0-g7b57bc998f
2018-01-23 23:30:53 InitParameterInteraction: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1
2018-01-23 23:30:53 Assuming ancestors of block 0000000000000000003b9ce759c2a087d52abc4266f8f4ebd6d768b89defa50a have valid signatures.
2018-01-23 23:30:53 Setting nMinimumChainWork=000000000000000000000000000000000000000000723d3581fe1bd55373540a
2018-01-23 23:30:53 Using the 'standard' SHA256 implementation
2018-01-23 23:30:53 Using RdRand as an additional entropy source
2018-01-23 23:30:53 Default data directory /root/.bitcoin
2018-01-23 23:30:53 Using data directory /root/.bitcoin
2018-01-23 23:30:53 Using config file /root/.bitcoin/bitcoin.conf
2018-01-23 23:30:53 Using at most 125 automatic connections (1024 file descriptors available)
@askmike
askmike / config-snippet.js
Created December 11, 2017 11:35
custom talib strat debugging
let candleFactor = 1;
config.tradingAdvisor = {
enabled: true,
method: 'magicdudecrypto',
candleSize: 3,
historySize: 25 * candleFactor,
adapter: 'sqlite'
}
@askmike
askmike / toggle-advice.js
Created October 28, 2017 02:30
SHORT-LONG-SHORT-LONG
var settings = {
wait: 0,
each: 6
};
// -------
var _ = require('lodash');
var log = require('../core/log.js');