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

Username
  

Password
  





Search Forums



(Advanced Search)

Forum Statistics
» Members: 39,322
» Latest member: DishisdesignJewellery
» Forum threads: 926
» Forum posts: 6,383

Full Statistics

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

Latest Threads
An official Gekko service...
Forum: Announcements
Last Post: tanvirai
11-20-2025, 12:18 PM
» Replies: 113
» Views: 291,729
Gekko development status ...
Forum: Announcements
Last Post: erectilenovus
11-17-2025, 11:36 AM
» Replies: 753
» Views: 1,768,686
Gekko 0.6 released
Forum: Announcements
Last Post: soniyathakur
11-02-2025, 12:21 PM
» Replies: 129
» Views: 380,423
Gekko with malware spotte...
Forum: Announcements
Last Post: cofffee124
10-30-2025, 09:56 AM
» Replies: 216
» Views: 346,321
New Gekko UI in the works
Forum: Announcements
Last Post: cofffee124
09-04-2025, 08:12 AM
» Replies: 186
» Views: 390,527
How to add Binance Future...
Forum: Technical Support
Last Post: Xavier32
10-07-2021, 02:20 PM
» Replies: 47
» Views: 159,121
Bittrex Configuration hel...
Forum: Bittrex
Last Post: yirzolusto
10-07-2021, 07:39 AM
» Replies: 6
» Views: 31,836
[Question] Why does gekko...
Forum: General Discussion
Last Post: cryptocurrency0
10-06-2021, 01:16 PM
» Replies: 16
» Views: 70,993
a couple of technical Que...
Forum: Technical Support
Last Post: mtom78632
10-06-2021, 11:08 AM
» Replies: 25
» Views: 87,740
Is there any way to make ...
Forum: Custom Systems
Last Post: seorun
10-05-2021, 08:20 AM
» Replies: 42
» Views: 134,739

 
  Gekkosys for multi-pair trading.
Posted by: Papa_Karma - 03-23-2018, 12:23 PM - Forum: Strategy Development - Replies (3)

Greetings everyone.

Not a programmer I am, so please ignore my ignorance. 
I can see logic in scripts (used to program human beings) and even edit till some point but struggling every time.

Perhaps there is a thread about things like this (could not find one, still reading through the forums) or you already tried to implement similar ideas so please share your thoughts Smile

I use gekko's awesomeness on binance when i can't trade manually (sometimes using multiple gekkos so i won't have to digg strats' code too much - one bot enters, the other exits).

1. Lately, in this sideway market with not a lot of action and signals, i trade multiple pairs (in a raw, not simultaneously - too harsh for me) for example: have eth and watching eth's assets that are listed also vs btc, usdt, bnb; buying, let's say neo had a signal, and watching neo vs majors; selling for bnb; etc. This kind of approach brings more trades and action to the boring down/sideways and is good for normal trends as well.

I am working now to combine an appropriate system of gekkos and strats but some kind of logical blindness makes it slow for me.

2. On binance, it shows usd price of an asset along the price in market's currency and happens, that there is enough difference between usd prices of the same asset. So my other  thought is about something that will monitor those differences and trade same asset across currencies. It looks possible but is it doable?

Thank you.
Live long, prosper and may the force be with you.


  Plot indicators on the graph?
Posted by: jasurakk - 03-21-2018, 01:30 PM - Forum: General Discussion - Replies (2)

Now that I have been testing different indicators and strategies with a Gekko's back testing tool, I have found it quite difficult to actually gain any progress since I can't find any way to plot all of my indicator's values to the chart, and thus I don't quite know that what happens and why? So, is there actually any way to do it in Gekko? I mean; could I configure Gekko so that for example EMA's are plotted to the price chart, and RSI's or CCI´s would be plotted on their own charts etc.?


  [SHARE] GAB - Gekko Automated Backtests
Posted by: tommiehansen - 03-21-2018, 12:01 PM - Forum: Third Party Software - Replies (147)

GAB
Gekko Automated Backtets

*** THIS IS BETA ***
If something does not work, it simply does not work since time hasn't existed yet to get it working.

Updated 14 april 2018 with MySQL as new option.

---

Why

I needed a way to run backtests for Gekko in a 'brute-force' manor automated and with multi-threading.
I also needed a way to compare all these runs and get extra data such as win percent etc.

-

Prerequisites (required)

1. Gekko installed and working
2. Webserver + PHP (preferrably 7.1+) with cURL and PDO SQLite or PDO MySQL/MariaDB
3. A user with write access

If you do not understand any of this it will be very hard to run this tool.
You can try googling for things such as install apache php 7.2.

-

How-to

0. Copy+Paste system/user.config.sample.php and rename the new file to user.config.php
1. Open user.config.php and make sure the $server variable is pointing at your Gekko install e.g. http://localhost:3000
2. Go to your-localhost/gab/ and see if it works.
3. Run something..
4. After you got some runs click 'View runs' in the menu and check results

--

Multi-server mode
If you're a nerd you can also use multi-server mode by specifying an array of servers instead of just one in your user.config.php like this:

$server = [
  'http://localhost:3000',
  'http://my-other-server:3000',
  'http://my-third-server:3000',
];

If your Gekko-files are not in sync on all these servers it will fail miserably though.
Setting an array will randomly use one of the servers to run a strategy.

In this case it's 3 so setting threads to e.g. 6 will usually mean 2 threads will run on each of these servers.
Do note that e.g. Chrome has a max concurrent connections @ 6 so in order to increase max-threads (and have it actually run in paralell) you would need to either force higher max concurrent connections or randomize/create subdomains for post.php (and remove any CORS restrictions).

-

Dynamic parameters
GAB uses dynamic parameters, these work for all strategy paramers. Example, RSI BULL/BEAR:


Code:
# SMA
SMA_long = 100:1000,100
SMA_short = 10:90,10

# BULL
BULL_RSI = 5:20,5
BULL_RSI_high = 70:90,5
BULL_RSI_low = 40:60,5

# BEAR
BEAR_RSI = 5:20,5
BEAR_RSI_high = 40:60,5
BEAR_RSI_low = 10:30,5


The format is <FROM>:<TO>,<STEPPING>.
This means that e.g. 10:20,5 will generate the range: 10,15,20
The params are inclusive meaning that odd stepping e.g. 5:15,10 will become 5,10,15 - the first and last of range is always kept.

-

Screens

Runner (select.php): https://i.imgur.com/kcXXMdW.png
Results (view.php): https://i.imgur.com/CPhvDEl.png

-

Donate

People keeps asking about this so i'll just leave it here for future reference:

BTC: 15cZUi7VvmCQJLbPXYYWChHF3JpsBaYDtH
ETH: 0xe03c5eb9DF93360e3Bcfcd13012B7DeebbED6923

-

Download

Go to: https://github.com/tommiehansen/gab/
or just clone: https://github.com/tommiehansen/gab.git


  Advice and Trade logs
Posted by: Kris191 - 03-20-2018, 04:26 PM - Forum: General Discussion - Replies (7)

Hi All,

where are all the trades made by the bots logged i'm running 2 bots in CLI and get advice via email but it doesn't log the trade anywhere, Advicelogger is active also.

Please help i'm looking to track these trades from Gekko rather than pulling directly form the exchanges.

Thanks


  Normalised Indicator to compare gains of different pairs
Posted by: Gryphon - 03-20-2018, 03:14 PM - Forum: Strategy Development - No Replies

I'm trying a 'moderator' approach to allow trading between multiple pairs - essentially a separate node server to run alongside gekko to receive the indicators from multiple gekko tradebots on different pairs, work out which is the best pair to be long on at any one time, and instructing the gekko bots to buy or sell accordingly

My first thought was to simply use a normalised EMA type comparison between all the pairs - whichever pair's ema has the most positive gradient goes long until another pair's ema gradient exceeds it, or it drops <0. A very simplistic approach to start with.

I know there are people here with far more experience using indicators than I have though, so I was wondering if anyone could recommend indicators that would be better suited to the task?

TIA Smile


  [Gekko development] Guaranteeing event order in the gekko stream
Posted by: askmike - 03-20-2018, 09:37 AM - Forum: Technical Discussion - Replies (1)

This is a technical post describing a solution in the architecture change of a gekko stream called the FIFO event emitter.

Gekko Streams have been in Gekko for over a year now, they represent a flexible collection of "plugins" that can all interact with each other using "events". The main idea is that each "plugin" is a box that consumes events and produces its own events. If you for example setup a "Gekko Paper trader" under the hood a number of plugins are created and glued together by Gekko, these plugins are (in the current 0.5.x version):

- Trading advisor: this plugin that takes candle data, feeds it into a stragy and emits new advice events.
- Paper trader: this plugin that takes advice events (from the trading advisor) calculates simulated roundtrips and emit new trade events.
- Performance analyzer: this plugins takes trade events and calculates overall statistics over them (profit, risk, etc) this plugin emits roundtrip events.

The beauty of keeping all the above plugins separate is that they are instant swappable: the only difference between a paper trader and a real trader is the second plugin in the above list being replaced with a plugin that actually real trades at a live exchange. Note that the input (advice events) and the output (trade events) are the same, this means that the other plugins don't care about what kind of trader is being ran (paper trader or live trader) as long as they send the same event in the same format. This essentially means that the plugins follow some kind of event based interface model.

The problem

During a backtest Gekko will compose the same set of plugins and pump market data (from a database) into them as fast as they can process them, the problem has to do with a main event called the "candle event" that represents an updated state of the market. This event is used by a lot of different plugins, for example by all 3 plugins in the list above. In response to the candle event the trading advisor can potentially broadcast an advice event, which will go into the paper trader who will emit a trade event. This event will go into the performance analyzer. Here is a visualization of what is happening.


[Image: 37642560-1f26e00a-2c50-11e8-8fc8-1c5ee00b941c.png]


It is extremely important that the paper trader can only process the advice event after it fully processed the candle event, because it needs simulate a trade based on the current price. The problem is guaranteeing that (which is ultimately determined by the order in which plugins are loaded which depends on a few different things).

How Gekko 0.5 solves it

The current Gekko (0.5x and below) does not actually deal with this problem, the implemented workaround is to add the candle the advice is based on to the candle event. The paper trader would completely ignore the raw candle event and always rely on the candle that was attached to the advice event. This works great and is fast, but it's a very limited workaround. In the new event system coming to 0.6 we will also issue events whenever anything in the portfolio changes. Which happens on every candle where the paper trader has a long exposure (assuming the price changed). This event is not possible in the current work around.

In depth

In most scenarios (for example during a backtest) all plugins are run in fully synchronous javascript code (in nodejs). This means that their complete execution will block everything else.

If we know that plugins will always execute everything synchronous we could defer the emitting of events to the next tick of the nodejs event loop. However doing so means that we need to guarantee that the next candle can only come in after all events have been propagated, which can become harder to manage. Especially if you don't want to use setTimeout since it does not allow for more than millisecond precision (which might potentially slow things down if you are queuing up a lot of orders) as well as the overhead of the node event loop. Keeping async plugins in mind, another downside is that it becomes tricky to parallelize multiple async plugins acting on the same event.

A more elegant solution is turn the native event emitter from nodejs (which behaves last in first out event queue, LIFO) into a FIFO (first in first out) event queue. Here is a visualization of the native nodejs event emitter applied to a gekko stream:

[Image: 37645125-87a6f0d6-2c58-11e8-9e2e-3180c29a40a9.png]

Take a look at red numbers which represent the order in which events are processed: This would cause the paper trader to act on advice using outdated market data (since the new candle has not hit the paper trader yet). Here is the gekko event emitter which forces all plugins to process an event (the candle event) before propagating the next one (the advice event).

[Image: 37645205-bb5b09e4-2c58-11e8-9d21-c8e7ce90b502.png]




The actual implementation consists of two parts:

1. Create a new class that allows plugins to emit an event but not actually propagate it straight away, add a function to emit an event which was pending (see the code).
2. Inside the main loop of the gekko stream, make sure to flush all pending events (one by one recursively) until all pending events are completely processed. Only after this start working with the next candle (see the code).

---

This is just the beginning, having more guarantees in place allow us to make more optimizations without having to worry about nasty race conditions.


  Maybe someone already did something like this?
Posted by: redriver - 03-19-2018, 09:09 PM - Forum: Strategy Development - No Replies

Привет всем 2
Я не знаю, как программировать.
Помоги мне, пожалуйста.
Я работаю над одной стратегией

Начало
Логика с каждой новой свечой

1) если открытых позиций нет
с новой свечой, которую бот покупает на рынке
после покупки ставит стоп-лосс (покупная цена -х)

2) если есть открытые позиции, то положите новый стоп-лосс (цена открытия новой свечи - x)

Как этот алгоритм будет выглядеть в Гекко?


Ценить любую помощь


  Internet connection loss
Posted by: arminb - 03-19-2018, 04:06 PM - Forum: General Discussion - Replies (3)

I noticed that my market watcher was removed as my internet connection got lost. Since then the bot did not trade. Now I manually created a new market watcher for the strat runner's exchange/currency/asset. The strat runner seems to have accepted the new market watcher and is up to date. Now I wonder if the bot will continue trading correctly? Also how can we prevent market watcher being removed on internet connection lost?


  Specify start time
Posted by: Shima - 03-19-2018, 03:11 PM - Forum: Feature Requests - Replies (1)

When running longer candle sizes (and maybe also other scenarios) it would be nice to be able to specify an exact time (and possibly date) for Gekko to go live. For example, if I run a strat on four hour candles and would like it fairly synchronized with TradeView candles so that I easier can analyze/predict the actions of Gekko, I don't want to sit around for two-three hours to press "enter" exactly when TradeView starts a new candle. I would much rather just set a start time as a switch in the console and then Gekko could run a market watcher until then so that market data is ready at the time it goes live.

Like for eample:
node gekko --config strategy.js --start 2018-02-14T04:00:00


  Custom Strategy ( bounty aditional :) )
Posted by: imsami - 03-18-2018, 03:15 PM - Forum: Strategy Development - Replies (5)

hello. I am new to gekko and do not have skill on java. I don't know is this doable with gekko or I am overestimating? Here is what I want to have :- 

[Image: 29386603_1713728585353611_54385756579467...e=5B2F814B]

EMA 5 - Green
EMA 12 - White
RSI 14 - level 50

BUY: EMA 5 Cross EMA 12 to upside, RSI greater than 50
SELL: EMA 5 Cross EMA 12 to downside, RSI less than 50

Do not SELL at SUPPORT, Do not BUY at RESISTANCE
Take Profit can be customized on percent and Stop loss too.  Thank you Smile