Skip to content

Instantly share code, notes, and snippets.

Avatar

Mike van Rossum askmike

View GitHub Profile
@askmike
askmike / example.js
Created Dec 9, 2018
example on using a gekko indicator with non standard input
View example.js
// 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');
View poloniex.js
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 Oct 10, 2018
TP example in a gekko strat
View example.js
strat.init = function() {
// your stuff
this.tp = false;
}
strat.check = function(candle) {
@askmike
askmike / example.js
Created Oct 4, 2018
expsoing this.advice in a gekko strat
View example.js
// 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
View v2.js
// 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 Apr 13, 2019
cdl3inside example
View cdl3inside.js
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 Jan 26, 2018
full node no routing
View debug.log
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 Jan 26, 2018
full node no routing
View debug.log
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 Dec 11, 2017
custom talib strat debugging
View config-snippet.js
let candleFactor = 1;
config.tradingAdvisor = {
enabled: true,
method: 'magicdudecrypto',
candleSize: 3,
historySize: 25 * candleFactor,
adapter: 'sqlite'
}
@askmike
askmike / toggle-advice.js
Created Oct 28, 2017
SHORT-LONG-SHORT-LONG
View toggle-advice.js
var settings = {
wait: 0,
each: 6
};
// -------
var _ = require('lodash');
var log = require('../core/log.js');