This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
strat.init = function() { | |
// your stuff | |
this.tp = false; | |
} | |
strat.check = function(candle) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', {}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let candleFactor = 1; | |
config.tradingAdvisor = { | |
enabled: true, | |
method: 'magicdudecrypto', | |
candleSize: 3, | |
historySize: 25 * candleFactor, | |
adapter: 'sqlite' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var settings = { | |
wait: 0, | |
each: 6 | |
}; | |
// ------- | |
var _ = require('lodash'); | |
var log = require('../core/log.js'); |
NewerOlder