Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

v0.6.8 #2669

Merged
merged 20 commits into from
Dec 2, 2018
Merged

v0.6.8 #2669

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions core/tools/dateRangeScanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ var scan = function(done) {
iterator.to -= BATCH_SIZE * 60;
},
() => {

if(!_.size(batches))
util.die('Not enough data to work with (please manually set a valid `backtest.daterange`)..', true);
if(batches.length === 0) {
return done(null, [], reader);
}

// batches is now a list like
// [ {from: unix, to: unix } ]

var ranges = [ batches.shift() ];

_.each(batches, batch => {
Expand All @@ -112,6 +112,7 @@ var scan = function(done) {
// we have been counting chronologically reversed
// (backwards, from now into the past), flip definitions
ranges = ranges.reverse();

_.map(ranges, r => {
return {
from: r.to,
Expand Down
4 changes: 2 additions & 2 deletions docs/commandline/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Go to the config and configure it like this:
simulationBalance: {
// these are in the unit types configured in the watcher.
asset: 1,
currency: 100,
currency: 100
},
// only want report after a sell? set to `false`.
verbose: false,
Expand Down Expand Up @@ -130,7 +130,7 @@ Mailer will automatically email you whenever Gekko has a new advice.
// guarantee that your email address & password are safe!

password: '', // Your GMail Password - if not supplied Gekko will prompt on startup.
tag: '[GEKKO] ', // Prefix all EMail subject lines with this
tag: '[GEKKO] ' // Prefix all EMail subject lines with this
}

- enabled indicates whether this is on or off.
Expand Down
10 changes: 5 additions & 5 deletions docs/extending/add_an_exchange.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ The callback needs to have the parameters of `err` and `ticker`. Ticker needs to

### getFee

this.exchange.getFee(callback)
this.exchange.getFee(callback);

The callback needs to have the parameters of `err` and `fee`. Fee is a float that represents the amount the exchange takes out of the orders Gekko places. If an exchange has a fee of 0.2% this should be `0.002`.

### getPortfolio

this.exchange.getPortfolio(callback)
this.exchange.getPortfolio(callback);

The callback needs to have the parameters of `err` and `portfolio`. Portfolio needs to be an array of all currencies and assets combined in the form of objects, an example object looks like `{name: 'BTC', amount: 1.42131}` (name needs to be an uppercase string, amount needs to be a float).

### getLotSize

this.exchange.getLotSize(tradeType, amount, size, callback)
this.exchange.getLotSize(tradeType, amount, size, callback);

The callback needs to have the parameters of `err` and `lot`. Lot needs to be an object with `amount` and `purchase` size appropriately for the exchange. In the event that the lot is too small, return 0 to both fields and this will generate a lot size warning in the portfolioManager.

Expand Down Expand Up @@ -114,13 +114,13 @@ Should return an amount. Rounds the amount into a valid amount Gekko Broker can

this.exchange.isValidPrice(price);

Should return true or falce. If the exchange has restrictions on the price you can submit limit orders at. If there are no such restrictions you should not implement this method.
Should return true or false. If the exchange has restrictions on the price you can submit limit orders at. If there are no such restrictions you should not implement this method.

### isValidLot

this.exchange.isValidLot(price, amount);

Should return true or falce. If the exchange has restrictions on the lot size (order size expressed in "currency" amount) you can check for that here. If there are no such restrictions you should not implement this method.
Should return true or false. If the exchange has restrictions on the lot size (order size expressed in "currency" amount) you can check for that here. If there are no such restrictions you should not implement this method.

## Error handling

Expand Down
4 changes: 2 additions & 2 deletions docs/features/paper_trading.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Paper trading

Gekko can automatically run a strategy over the live markets and simulate in realtime what happen if you would have traded on its signals. Paper trading and [backtesting](../backtesting.md) are the two simulation modes that come with Gekko. It's a great way to experiment with strategies without putting your money on the line.
Gekko can automatically run a strategy over the live markets and simulate in realtime what happen if you would have traded on its signals. Paper trading and [backtesting](./backtesting.md) are the two simulation modes that come with Gekko. It's a great way to experiment with strategies without putting your money on the line.

You can start a paper trader by going to live gekkos and clicking on "Start a new live Gekko".

Keep in mind that a paper trader is a simulation, and the accuracy depends on the market you decide to run it on (you'll get pretty accurate results on big markets like USD/BTC). You can read more about the details and limitations of the simulation on [the backtesting page](./backtesting.md#Simplified-simulation).
Keep in mind that a paper trader is a simulation, and the accuracy depends on the market you decide to run it on (you'll get pretty accurate results on big markets like USD/BTC). You can read more about the details and limitations of the simulation on [the backtesting page](./backtesting.md#Simplified-simulation).
4 changes: 2 additions & 2 deletions docs/installation/configuring_gekko_on_a_server.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ You can now access the Gekko UI by going to `http://x.x.x.x:3000` in a browser (

## Configuring Gekko to run in the cloud

Important note: if you expose Gekko to the open internet (or on any non trusted network) you are recommended to put a secure reverse proxy (for example with both [SSL](#obtaining-a-ssl-certificate) and [BasicAuth](#create-htpasswd-for-basic-password-authentication)) in front of it. While we believe Gekko is hard to exploit, it allows for 24/7 backtesting which will drain your machine's resources (possible DoS).
Important note: if you expose Gekko to the open internet (or on any non trusted network) you are recommended to put a secure reverse proxy (for example with both [SSL](#Obtaining-a-SSL-certificate) and [BasicAuth](#Create-htpasswd-for-basic-password-authentication)) in front of it. While we believe Gekko is hard to exploit, it allows for 24/7 backtesting which will drain your machine's resources (possible DoS).

The following assumes you configured a reverse proxy, if you did not simply follow [these instructions](#configuring-nginx-as-a-reverse-proxy) to do so.
The following assumes you configured a reverse proxy, if you did not simply follow [these instructions](#Configuring-NGINX-as-a-reverse-proxy) to do so.


const CONFIG = {
Expand Down
4 changes: 2 additions & 2 deletions docs/internals/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ and will start signaling advice.
entryAt: Moment<'2017-03-25 19:41:00'>,
entryPrice: 10.21315498,
entryBalance: 98.19707799420277,
exitAt: Moment<'2017-03-25 19:41:00'>
exitAt: Moment<'2017-03-25 19:41:00'>,
exitPrice: 10.22011632,
exitBalance: 97.9692176,
duration: 3600000,
Expand Down Expand Up @@ -296,7 +296,7 @@ and will start signaling advice.
entryAt: Moment<'2017-03-25 19:41:00'>,
entryPrice: 10.21315498,
entryBalance: 98.19707799420277,
exitAt: Moment<'2017-03-25 19:41:00'>
exitAt: Moment<'2017-03-25 19:41:00'>,
exitPrice: 10.22011632,
exitBalance: 97.9692176,
duration: 3600000,
Expand Down
2 changes: 1 addition & 1 deletion docs/introduction/scope.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Gekko is a free and open source tool that is designed as a starters kit for auto

## Market data

Gekko aggregates all market data into minutely candles (OHLC, VWP and amount of trades). This means Gekko only has to store candles on disk, which take up a predictable amount of space on your harddrive. The tradebot will use some additional market data (the orderbook) to make efficient execute orders efficiently, but this data is not visible anywhere else.
Gekko aggregates all market data into minutely candles (OHLC, VWP and amount of trades). This means Gekko only has to store candles on disk, which take up a predictable amount of space on your harddrive. The tradebot will use some additional market data (the orderbook) to execute orders efficiently, but this data is not visible anywhere else.

## Strategies

Expand Down
2 changes: 2 additions & 0 deletions docs/introduction/supported_exchanges.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Gekko is able to directly communicate with the APIs of a number of exchanges. Ho
| [Bitfinex][7] | ✓ | ✓ | ✓ | |
| [Bittrex][8] | ✓ | ✕ | ✕ | API problems ([#2310][26])|
| [coinfalcon][25] | ✓ | ✓ | ✓ | |
| [EXMO][27] | ✓ | ✓ | ✕ | |
| [wex.nz][9]* | ✓ | ✓ | ✕ | |
| [Gemini][10]* | ✓ | ✓ | ✕ | |
| [Okcoin.cn][11]* | ✓ | ✓ | ✕ | China, see [#352][20] |
Expand Down Expand Up @@ -60,3 +61,4 @@ Gekko is able to directly communicate with the APIs of a number of exchanges. Ho
[24]: https://www.binance.com/?ref=11236330
[25]: https://coinfalcon.com/?ref=CFJSQBMXZZDS
[26]: https://github.com/askmike/gekko/pull/2310
[27]: https://exmo.com
2 changes: 1 addition & 1 deletion docs/strategies/creating_a_strategy.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Most strategies need to warmup before the trading strategy can be started. For e
If you find out in the check function that you want to give new advice to the trader you can use the advice function:

this.advice({
direction: 'long' // or short
direction: 'long', // or short
trigger: { // ignored when direction is not "long"
type: 'trailingStop',
trailPercentage: 5
Expand Down
18 changes: 9 additions & 9 deletions docs/strategies/gekko_indicators.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ If you want to use the MACD indicator from Gekko, you need to register it in you

Here is a list of all supported indicators, click on them to read more about what they are and how to implement them in Gekko:

- [EMA](#ema)
- [PPO](#ppo)
- [CCI](#cci)
- [DEMA](#dema)
- [LRC](#lrc)
- [MACD](#macd)
- [RSI](#rsi)
- [SMA](#sma)
- [TSI](#tsi)
- [EMA](#EMA)
- [PPO](#PPO)
- [CCI](#CCI)
- [DEMA](#DEMA)
- [LRC](#LRC)
- [MACD](#MACD)
- [RSI](#RSI)
- [SMA](#SMA)
- [TSI](#TSI)
- [UO](#UO)

### EMA
Expand Down
42 changes: 28 additions & 14 deletions docs/strategies/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,17 @@ You can configure the following parameters:

### MACD

This strategy is similar to DEMA but goes a little further by comparing the difference by an EMA of itself. Read more about it [here](http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:moving_average_convergence_divergence_macd).
The MACD is one of the most popular trend watching **indicators** in finance, it was created by Gerald Appel in the late 1970s. By using multiple price averages (EMAs) of different periods (one that follows the market more closely and one that lags behind, only catching bigger price swings). The indicator itself ouputs multiple numbers, when comparing them they can be interepted as signals that show when the trend of the price is changing.

The MACD **strategy** in Gekko is a simple strategy that implements the indicator. By comparing the difference between the EMAs from the signal the strategy triggers buy and sell signals. The strategy does come with additional logic:

- **thresholds**: a signal will be triggered as soon as the difference goes above or below a configurable threshold, making the strategy more flexible than simply checking if the difference is above or below zero. If you set these to 0 each line cross would trigger new advice.
- **persistance**: instead of trading as soon the difference is above or below the threshold, the strategy will wait a few candles to see if the difference keeps persisting. Only if it does the strategy will actually signal to Gekko to buy or sell. By setting persistance to 0 this behaviour is disabled.
- **short** is the short EMA that moves closer to the real market (including noise)
- **long** is the long EMA that lags behind the market more but is also more resistant to noise.
- **signal** is the EMA weight calculated over the difference from short/long.

Read more about it [here](http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:moving_average_convergence_divergence_macd).

You can configure the following parameters:

Expand All @@ -65,12 +75,6 @@ You can configure the following parameters:
# before we consider it real?
persistence = 1

- short is the short EMA that moves closer to the real market (including noise)
- long is the long EMA that lags behind the market more but is also more resistant to noise.
- signal is the EMA weight calculated over the difference from short/long.
- the down threshold and the up threshold tell Gekko how big the difference in the lines needs to be for it to be considered a trend. If you set these to 0 each line cross would trigger new advice.
- persistence tells Gekko how long the thresholds needs to be met until Gekko considers the trend to be valid.

### PPO

Very similar to MACD but also a little different, read more [here](http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:price_oscillators_ppo).
Expand Down Expand Up @@ -99,7 +103,15 @@ You can configure the following parameters:

### RSI

The Relative Strength Index is a momentum oscillator that measures the speed and change of price movements. Read more about it [here](http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:relative_strength_index_rsi).
The RSI indicator is and old but ever popular trend watching **indicator**, introduced in 1978 by J. Welles Wilder this simple indicator has never stopped to be a popular tool for traders. In its essence RSI follows a simple formula to measure the speed by which the price is changing. When the price keeps going up at an accelarating rate the market might be overbought and a reversal might come next.

The RSI **strategy** in Gekko is a simple strategy that implements the RSI indicator. By calculating the RSI as the market develops this strategy can trigger buy or sell signals based on the RSI going too high (overbought) or too low (oversold). The strategy does come with additional logic:

- **interval** is the amount of periods the RSI should use.
- **thresholds** determine what level of RSI would trigger an up or downtrend.
- **persistance**: instead of trading as soon the difference is above or below the threshold, the strategy will wait a few candles to see if the difference keeps persisting. Only if it does the strategy will actually signal to Gekko to buy or sell. By setting persistance to 0 this behaviour is disabled.

Read more about it [here](http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:relative_strength_index_rsi).

You can configure the following parameters:

Expand All @@ -112,12 +124,16 @@ You can configure the following parameters:
# before we consider it real?
persistence = 2

- The interval is the amount of periods the RSI should use.
- The thresholds determine what level of RSI would trigger an up or downtrend.
- persistence tells Gekko how long the thresholds needs to be met until Gekko considers the trend to be valid.

### StochRSI

The StochRSI indicator uses an RSI indicator at its core and as such is similar to the RSI strategy that uses this indicator. The difference is that after the RSI is calculated a stochastic oscillator is calculated over the resulting RSI values. When a market is trending upwards for a long time the RSI values tend to go and stay high. The stochastic oscillator will compare the RSI values from the last period with eachother. This results in the StochRSI indicator therefor indicate how high or low the RSI values have been historically over the last n periods.

The StochRSI **strategy** in Gekko is a simple strategy that implements the StochRSI indicator. By calculating the StochRSI as the market develops this strategy can trigger buy or sell signals based on the signal going too high (overbought) or too low (oversold). The strategy does come with configurables:

- **interval**: This setting defines both the RSI interval used to calculate the RSI values as well as the historical period used by the stochastic oscillator to compare RSI values with.
- **persistance**: instead of trading as soon the difference is above or below the threshold, the strategy will wait a few candles to see if the difference keeps persisting. Only if it does the strategy will actually signal to Gekko to buy or sell. By setting persistance to 0 this behaviour is disabled.
- **thresholds**: The high and low thresholds are defined as numbers between 1 and 100. Different from StochRSI in other trading systems, this number indicates a percentage instead of a fraction of 1.

You can configure the following parameters:

interval = 3
Expand All @@ -127,8 +143,6 @@ You can configure the following parameters:
high = 80
persistence = 3

[TODO!]

### CCI

You can configure the following parameters:
Expand Down
Loading