Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums



(Advanced Search)

Forum Statistics
» Members: 28,473
» Latest member: siewkukurydzy
» Forum threads: 1,541
» Forum posts: 8,062

Full Statistics

Online Users
There are currently 317 online users.
» 0 Member(s) | 317 Guest(s)

Latest Threads
Gekko development status ...
Forum: Announcements
Last Post: BeardDemon
Yesterday, 07:22 AM
» Replies: 1,005
» Views: 930,846
Gekko 0.6 released
Forum: Announcements
Last Post: Pharagon
11-23-2024, 10:13 AM
» Replies: 122
» Views: 269,000
An official Gekko service...
Forum: Announcements
Last Post: drivemad2
11-22-2024, 07:24 AM
» Replies: 103
» Views: 189,792
New Gekko UI in the works
Forum: Announcements
Last Post: clduplicateremover
11-18-2024, 08:21 PM
» Replies: 174
» Views: 227,588
Gekko with malware spotte...
Forum: Announcements
Last Post: thesyrise
11-16-2024, 10:12 PM
» Replies: 188
» Views: 170,041
How to Soft Reset or Hard...
Forum: General Discussion
Last Post: lucifar
10-07-2021, 07:18 PM
» Replies: 22
» Views: 53,000
How to add Binance Future...
Forum: Technical Support
Last Post: Xavier32
10-07-2021, 02:20 PM
» Replies: 47
» Views: 108,357
Bittrex Configuration hel...
Forum: Bittrex
Last Post: yirzolusto
10-07-2021, 07:39 AM
» Replies: 6
» Views: 19,108
[Question] Why does gekko...
Forum: General Discussion
Last Post: cryptocurrency0
10-06-2021, 01:16 PM
» Replies: 16
» Views: 45,818
a couple of technical Que...
Forum: Technical Support
Last Post: mtom78632
10-06-2021, 11:08 AM
» Replies: 25
» Views: 58,574

 
  Error: SQLITE_CORRUPT
Posted by: ManuManu - 02-23-2018, 12:43 AM - Forum: Technical Support - Replies (1)

Hey, 

Just to let you know :
From time to time, I had this error fired :
{ Error: SQLITE_CORRUPT: database disk image is malformed errno: 11, code: 'SQLITE_CORRUPT' }

It looks like the importer failed at some point ( perhaps just because my computer turned to standby mode, or I quit Gekko while importing ).

In the end, I had a corrupted table in my database, that I've just erased, and it looks fine for now.

Manu


  Backtest multitreading
Posted by: xFFFFF - 02-22-2018, 05:21 PM - Forum: Feature Requests - Replies (3)

Its possible? Now backtest use only 1 thread. NN strats tests take a lot time. Maybe when supporting other cpu cores will be better.


Information [TUT] Backtesting with gekkoga
Posted by: Gryphon - 02-22-2018, 02:51 PM - Forum: Guides - Replies (57)

After posting a few results from gekkoga, I've received quite a few questions from people struggling to get it working - I thought I'd answer them all at once here!

I have no affiliation with gekkoga at all - it has been created by http://gekkowarez.com, and is hosted on github here - all credit goes to them! I'm also not an expert by any means, but I have managed to get it working!


Update
Just a small disclaimer here - Gekkoga looks for the best possible parameters for a given set of data. This results in the parameters being heavily over fitted to that data. A hugely profit optimised strategy in backtest will likely give a crap strategy when run live, as the market doesn't repeat itself! The results from gekkoga can give a good indication of the approximate parameters to use, but that's about it. Use common sense and don't get bought by 10,000% yearly profits in backtests!
Pay attention to the sharpe ratio, drawdowns and % profitable trades etc on each strategy for judging how good it might actually be live. Smile


What is GekkoGA?
It applies a genetic algorithm to the parameters of a gekko trading strategy and uses the gekko backtesting API to run it over and over to find the optimum settings. Each epoch, it takes the top parameters found in the previous epoch and adjusts a few of the values, introduces some totally new random parameter sets, and runs them all against each other ad-infinitum. The global best result per strategy and pair is stored in the results folder.

There is no GUI, this is command line only.

Genetic Algorithms doing their thing is probably best visualised here: http://rednuht.org/genetic_cars_2/ 




Installing gekkoga
Follow the instructions in the git readme!
As an overview, clone the git repo into your gekko folder, then run npm install in the new gekkoga folder. 

Setting up the config file

The sample-config.js in the config folder is a very good start, but will need a couple of changes to run with your data and your strategies.

  1. Strategy (line 4): This has to match exactly (case sensitive) the name of the strategy you want to run the GA on.
  2. Exchange (line7): name of the exchange as it appears in the Gekko UI.
  3. Asset and Currency (8,9): The trading pair to use.
  4. Date Range(12+): If you only have one period of data to backtest on, leave it as 'scan'. If you have more than one period, enter the start and finish dates and uncomment/comment the relevant lines.
Code:
const config = {
 stratName: 'RSI_Bull_Bear_Adx',
 gekkoConfig: {
   watch: {
     exchange: 'binance',
     currency: 'BTC',
     asset: 'NEO'
   },

   daterange: 'scan',

   // daterange: {
   //   from: '2017-12-08 06:24:00',
   //   to: ' 2018-02-16 07:24:00'
   // },

Finally at the end of the file, we need to specify the parameters for the strategy. 

First there is an array of candle lengths to test. These are values in minutes. Enter as many as you want, comma separated:
Code:
candleValues: [9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25],

The values below history size need to match those in the strategies .toml exactly, and every value from the .toml file needs to be entered.

The history size needs to be equal to the longest possible history required in the strategy. In my case for Tommie's RSI_Bear_Bull strategy, this will be the SMA_long value, and I am giving it a maximum of 1300, therefore history is set to 1300.

If you want to fix any other variables, you can simply give them that value, rather than the random generator with limits.

Gekkoga uses the randomExt library to generate random values for testing. These can be integer or float (simply replace the .integer with .float) and the range is defined in the brackets: (maxVAlue, minValue).

You can also perform calculations on these values, as I show below for SMA_long. As 1300 to 500 is a rather large range, I'm numbers between 27 and 10, and multiplying them out to the values I want. I think this should speed things up and allow refining in a narrower range later - that's just my theory though.

Code:
   historySize: 1300, // max possible SMA_long

   SMA_long: randomExt.integer(27, 10) * 50, // From 1300 to 500 in steps of 50
   SMA_short: randomExt.integer(60, 40),

   BULL_RSI: randomExt.integer(13, 7),
   BULL_RSI_high: randomExt.integer(85, 70),
   BULL_RSI_low: randomExt.integer(65, 40),

   BEAR_RSI: randomExt.integer(20, 10),
   BEAR_RSI_high: randomExt.integer(60, 40),
   BEAR_RSI_low: randomExt.integer(30, 10),

   ADX: randomExt.integer(5, 2),
   ADX_high: randomExt.integer(80, 60),
   ADX_low: randomExt.integer(60, 40),

Config all done!

Running gekkoga

Before starting gekkoga there is one tweak to the gekko config we need to do to stop it timing out on the longer back tests. Open gekko/web/vue/UIconfig.js and increase the timeout setting. I've set it to 480000 (8 minutes). If this is too low you will get a Socket error after a little while backtesting.
  • Start gekko - I use "node gekko --ui" as I find it useful to see the available history and be able to run UI backtests on the parameters that gekkoga finds. The server.js command recommended by gekkoga always crashes for me!
  • In a second terminal window navigate to gekko/gekkoga and enter "node run --config config/your-config-here.js"
That should start your backtesting! If it doesn't stop with an error of some sort in the next few seconds then congratulations! You're in the minority... Which brings us to the next section:

Troubleshooting (help, it crashed!)
To troubleshoot gekkoga we need to have both the logs from gekko, and the console logs from gekkoga, so have both terminals open, or if you are running through PM2 or equivalent, open up the logs.

1) Crashes immediately. Gekko log shows 'Child Process has died', gekkoga log shows server error 500.

This is most likely an issue with the config that you have just created. Any typos in the strategy name, trading pair or exchange will give this.

2) Crashes after a random period of time. Gekko log shows 'Child Process has died', gekkoga log shows server error 500.

I have had this a few times where my randomly generated ranges provide values outside those supported by the indicators. For example, a candle size of 1 will cause this, an ADX value of 1 will also cause this. I imagine trying to give -ve numbers to SMA parameters will also cause this. 

3) Backtest runs without errors but never makes any trades.

This is most likely due to a typo on the parameter names, or if there is a variable in the strategy .toml file that is not in your gekkoga config. This results in that variable being undefined in gekko, and as such trading advice calculations fail, but very often fail silently! If visual inspection doesn't fix this, open the strategy.js file and add debug messages in the init block to print out each passed in variable to the console, i.e.

Code:
log.debug('Generated SMA_long = '+this.SMA_long);

Run the GA again and watch gekko's console log - this will quickly identify any undefined variables.

I am sure I have had more errors, but I can't remember them at the moment, I'll add them as I find/remember them!

For reference, here is a complete gekkoga config that I have been using (messy comments and all):
Github Gist

Code:
const randomExt = require('random-ext');

const config = {
 stratName: 'RSI_Bull_Bear_Adx',
 gekkoConfig: {
   watch: {
     exchange: 'binance',
     currency: 'BTC',
     asset: 'POWR'
   },

   daterange: 'scan',

   // daterange: {
   //   from: '2017-12-08 06:24:00',
   //   to: ' 2018-02-16 07:24:00'
   //   //to: '2017-12-05 15:04:00'
   // },

   simulationBalance: {
     'asset': 0,
     'currency': 100
   },

   slippage: 0.05,
   feeTaker: 0.25,
   feeMaker: 0.15,
   feeUsing: 'taker', // maker || taker

 },
 apiUrl: 'http://localhost:3000',

 // Population size, better reduce this for larger data
 populationAmt: 20,

 // How many completely new units will be added to the population (populationAmt * variation must be a whole number!!)
 variation: 0.5,

 // How many components maximum to mutate at once
 mutateElements: 7,

 // How many parallel queries to run at once
 parallelqueries: 8,

 // profit || score
 // score = profit * sharpe -- feedback?
 // profit = recommended!
 mainObjective: 'profit',

 // optionally recieve and archive new all time high every new all time high
 notifications: {
   email: {
     enabled: false,
     receiver: 'me@gmail.com',
     senderservice: 'gmail',
     sender: 'me@gmail.com',
     senderpass: '----',
   },
 },
 candleValues: [9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25],
 //candleValues: [2, 3, 4, 5], //Really doesn't work!
 getProperties: () => ({
   // Strat settings must be flattened and cannot be nested for mutation to work properly!

   /*
   # SMA Trends
   SMA_long = 1000
   SMA_short = 50
   # BULL
   BULL_RSI = 10
   BULL_RSI_high = 80
   BULL_RSI_low = 60
   # BEAR
   BEAR_RSI = 15
   BEAR_RSI_high = 50
   BEAR_RSI_low = 20
   # ADX
   ADX = 3
   ADX_high = 70
   ADX_low = 50
   */
   historySize: 1300, // max possible SMA_long

   SMA_long: randomExt.integer(27, 10) * 50, // From 1300 to 500 in steps of 50
   SMA_short: randomExt.integer(60, 40),

   BULL_RSI: randomExt.integer(13, 7),
   BULL_RSI_high: randomExt.integer(85, 70),
   BULL_RSI_low: randomExt.integer(65, 40),

   BEAR_RSI: randomExt.integer(20, 10),
   BEAR_RSI_high: randomExt.integer(60, 40),
   BEAR_RSI_low: randomExt.integer(30, 10),

   ADX: randomExt.integer(5, 2),
   ADX_high: randomExt.integer(80, 60),
   ADX_low: randomExt.integer(60, 40),

   candleSize: config.candleValues[randomExt.integer(config.candleValues.length - 1, 0)]

 })
};

module.exports = config;


Sad Adding Bitstamp on the excange list
Posted by: JoshuaKeen - 02-22-2018, 01:06 PM - Forum: Technical Support - No Replies

Hello everyone and thank you for creating this fantastic forum. 
I have a newbie question. Big Grin
How can I add Bitstamp to the list of supported excange for data importing?

JoshuaKeen


  A way to edit the amount of times the bot will retry orders from the UI
Posted by: Shrike998 - 02-22-2018, 11:20 AM - Forum: Feature Requests - No Replies

It would be great if you could add a function in the UI on both the backtesting screen and also realtime where you could change the amount of times the bot retries orders if not filled (fully)

also maybe to change the amount of time before the bot will attempt a retry?

cheers Smile


  Newbie questions
Posted by: BigJohn - 02-22-2018, 02:23 AM - Forum: General Discussion - Replies (6)

Hi all, I'm a Gekko newbie and so far I love it!

I have some questions I hope I can get answered.

1. I see that DEMA has been recently changed to a new formula. I don't quite understand what the new DEMA strategy does. Is it possible to still do the old 10/21 candles EMA strategy? If so, how?

2. Is there any way to visualize the indicators on a graph through the UI? Like with the 10/21 EMAs, it would be nice to actually see the EMA lines on a graph to see where it crosses over, and where Gekko gets triggered for a buy/sell.

3. My config that I'm using has a warmup period. But say I want to restart Gekko to change some parameters, is there a way for it to just use the data from previous runs of Gekko without having to do another inactive warmup period? I guess I'm asking if Gekko saves real-time data it's getting from the exchange so it can be used for warmup by the next run of Gekko.

4. Is there any way to change a parameter in the config in real-time while Gekko is running? Like say the candle-size or weight?


  Save the imported data before reinstalling
Posted by: JoshuaKeen - 02-22-2018, 12:21 AM - Forum: Technical Discussion - Replies (2)

I would uninstall Gekko and reinstall it (I think I did some damage lol).
Is it possible to save all the backtesting data that I recovered from the various excange?
Thanks for any answers!


  NVT indicators
Posted by: xFFFFF - 02-21-2018, 10:17 PM - Forum: General Discussion - Replies (3)

I found info about this indicators at Taiwan's Gekko telegram group: http://charts.woobull.com/bitcoin-nvt-ratio/

Is looking interesing.


  Multiple Strategies Using Overlapping Indicators
Posted by: BradT7 - 02-21-2018, 08:40 PM - Forum: Technical Support - No Replies

Hello, I've got this strategy that in theory works out okay in my head, but I'm wondering if it can be applied in real world using 5 live traders.

     USDT
      /     \
    /         \
ETH <> BTC
    \         /
       \    /
   ALT Coin

Here are the indicators I'm looking to use:
BTC/ALT
ETH/ALT
BTC/ETH
USDT/BTC
USDT/ETH

Each strategy  would probably have it's own custom strategy variables applied to it.


Here's an example, lets say I'm currently holding ALT, the idea being trade ETH/ALT, if it sells into ETH but after a day or so BTC is doing better than ETH and ALT still isn't doing great, the BTC/ETH will switch into BTC.
If ALT starts doing better again than BTC, (which was recently better and traded over from ETH) the BTC/ALT will buy back into ALT again.
Alternatively, if the market takes a turn for the downside while sitting in BTC for example, ideally ALT's losses would also be greater than BTC and the USDT/BTC strategy would switch into USDT.
Now if the market starts recovering, perhaps ETH is out performing BTC and then the USDT/ETH picks up the trade first.
Now if ALT is also recovering faster than ETH, my ETH/ALT trades back into ALT for me again.

Rinse and repeat.

My thought is if the assets are sitting in ALT, my USDT/BTC strategy won't care because both assets would be zero, and ALT would trade into either BTC to ETH, depending on which indicator is triggered first. But still being able to go between BTC/ETH if sitting on the ALT sidelines so to speak.

Any insight on how to best technically accomplish this? Is it okay to run all 5 at the same time within the UI?
I saw somewhere else in the forum this may be possible if running multiple strategies through the UI?
I may have read somewhere gekko doesn't work the greatest running more than one strategy at once? If that is correct, in theory if I had 5 different virtual machines each running one strategy would it be okay to do this? i.e. running live strategies while both assets for some of those strategies might be zero for some time.

Thanks!


  Error Bitstamp says this API keys is invalid..
Posted by: et7223 - 02-21-2018, 05:32 PM - Forum: Technical Support - No Replies

I am able to do Paper Trade perfectly but when I switch to Bot Trade, I am getting the below error:
Gekko encountered an error and can't continue
Error:
Bitstamp says this API keys is invalid..

meta debug info:
Gekko version: v0.5.12
Nodejs version: v8.9.4

I also try to delete the API and regenerated a new one and also did that in the config but no luck.
Can someone please help?