a couple of technical Questions
#1
Hello, 
first of all I want to thank you all here for the great work... I have been researching trading bots along time now, and I have to admit your work here is great... so thanks... and keep up the great work... 
also looking forward for the hosted Gekko that you announced... that could be great for a lot of us... 

now to my questions... 
I am setting Gekko up to run in an VPS on Linux, and I am convinced with a good strategy that I want to try now live... 
And after reading the comments of ASKMIKE I decided to run Gekko from the CL 
but I still have some Questions: 

1. the ORDERS: 
how will Gekko perform the orders on the exchanges ? are they market orders or limit orders ? and if they are limit orders, and they don't trigger (the price moved very fast) will it cancel the order or not? and if they are Market Orders, will it consider the Advice price as the start or the real price that it was able to get on the exchange ? 

and because we are in Exchanges (not CFDs) does this mean Gekko will never be able to run a Short before it had a Long right? 

2. Margin: 
is it possible to make Gekko run Margin Orders (in Bitfinix for example!) or will it always run an exchange order?

3. Multiplie instances: 
I understood from multiple  comments from Mike, that Gekko always uses 100% of the asset to run a strategy, so if I want trade more than one trader on the same exchange I should use disjunct couples i.e. BTC/USD , ETH/EUR for example... and I need to start a different Terminal window and a Gekko in every one... the main Question now: 
do I need to make a different copy of Gekko (different folder) for every Livetrade Gekko?  I understand that I have to change the config files for every Livetrade Setup (to add the different APIs if I am using different exchanges, and to add different parameters for the same strategy or different strategies.. IS THIS right? 
so for example If I want to run 3 Pairs (BTC/USD, ETH/EUR on Bitfiniex and BTC/LTC on Binance) I make 3 copies of Gekko, run every one separate  in a terminal window and leave it working... 
Am I right? 


I appreciate your help very much... 
thanks..
  Reply
#2
Good questions!

> how will Gekko perform the orders on the exchanges ? are they market orders or limit orders ? and if they are limit orders, and they don't trigger (the price moved very fast) will it cancel the order or not? and if they are Market Orders, will it consider the Advice price as the start or the real price that it was able to get on the exchange ?

There currently is only one execution strategy and it is explained here: https://gekko.wizb.it/docs/introduction/...n-strategy

There is an active discussion on making this more extensible, see here: https://github.com/askmike/gekko/pull/18...-362974808

> is it possible to make Gekko run Margin Orders (in Bitfinix for example!) or will it always run an exchange order?

Not possible for now, profit calculations are a lot more complex because of the new number of variables (like interest).

> I understand that I have to change the config files for every Livetrade Setup (to add the different APIs if I am using different exchanges, and to add different parameters for the same strategy or different strategies.. IS THIS right?

You usually only have to create a new config file and point gekko to that one when you start it: node gekko -c my-other-config.js

Especially if you only run say 3 different ones (on linux) and see how it goes from there.
  Reply
#3
Nice Answers thanks.. 
just last Q to make sue... 

this:: 

> I understand that I have to change the config files for every Livetrade Setup (to add the different APIs if I am using different exchanges, and to add different parameters for the same strategy or different strategies.. IS THIS right?

You usually only have to create a new config file and point gekko to that one when you start it: node gekko -c my-other-config.js

Especially if you only run say 3 different ones (on linux) and see how it goes from there.

means I will have a diffrent config for every different pare or connections right?
so in my example just 3 different configfiles.. :Smile


tnanks again mike.
  Reply
#4
ok.. 
my last Q is irrelevant now... I understood that I should use different config files, and I managed it too... 

now I am trying first to let them all first import different data to get used to the CL process.. 

the setup is like this: 
I have an VPS server running Ubuntu 16.04 LTS wit no GUI. 

from my local Mac I have three SSH connections (3 terminal windows) and every one is running a different config file with import. 

the Questions I have now: 

1. if I close the ssh windows, will it still work in the background on the server (all three) ? 
2. why I get this in binance:?
2018-02-10 05:21:53 (DEBUG): [binance.js] (getTrades) returned an error, retrying: ETIMEDOUT
2018-02-10 05:22:38 (DEBUG): [binance.js] (getTrades) returned an error, retrying: ETIMEDOUT
2018-02-10 05:23:23 (DEBUG): [binance.js] (getTrades) returned an error, retrying: ETIMEDOUT
2018-02-10 05:24:08 (DEBUG): [binance.js] (getTrades) returned an error, retrying: ETIMEDOUT
2018-02-10 05:24:33 (DEBUG): [binance.js] (getTrades) returned an error, retrying: ETIMEDOUT
2018-02-10 05:25:00 (DEBUG): [binance.js] (getTrades) returned an error, retrying: ETIMEDOUT
2018-02-10 05:25:30 (DEBUG): [binance.js] (getTrades) returned an error, retrying: ETIMEDOUT
2018-02-10 05:26:02 (DEBUG): [binance.js] (getTrades) returned an error, retrying: ETIMEDOUT
2018-02-10 05:26:38 (DEBUG): [binance.js] (getTrades) returned an error, retrying: ETIMEDOUT
2018-02-10 05:27:18 (DEBUG): [binance.js] (getTrades) returned an error, retrying: ETIMEDOUT
2018-02-10 05:28:03 (DEBUG): [binance.js] (getTrades) returned an error, retrying: ETIMEDOUT
2018-02-10 05:28:48 (DEBUG): [binance.js] (getTrades) returned an error, retrying: ETIMEDOUT
2018-02-10 05:29:33 (DEBUG): [binance.js] (getTrades) returned an error, retrying: ETIMEDOUT
2018-02-10 05:30:18 (DEBUG): [binance.js] (getTrades) returned an error, retrying: ETIMEDOUT


3. I get things like this from Bitfinex on ETHUSD 
2018-02-10 05:32:23 (DEBUG): Querying trades with: trades/tETHUSD/hist?limit=1000&start=1486519200000&end=1486605600000

2018-02-10 05:32:23 (DEBUG): [bitfinex.js] (getTrades) returned an error, retrying: StatusCodeError: 429 - ["error",11010,"ratelimit: error"]

2018-02-10 05:33:33 (DEBUG): [bitfinex.js] (getTrades) returned an error, retrying: StatusCodeError: 429 - ["error",11010,"ratelimit: error"]

2018-02-10 05:34:57 (DEBUG): Trade fetch came back empty.

2018-02-10 05:35:01 (DEBUG): Querying trades with: trades/tETHUSD/hist?limit=1000&start=1486605600000&end=1486692000000

2018-02-10 05:35:01 (DEBUG): Trade fetch came back empty.

2018-02-10 05:35:04 (DEBUG): Querying trades with: trades/tETHUSD/hist?limit=1000&start=1486692000000&end=1486778400000

2018-02-10 05:35:04 (DEBUG): Trade fetch came back empty.

2018-02-10 05:35:08 (DEBUG): Querying trades with: trades/tETHUSD/hist?limit=1000&start=1486778400000&end=1486864800000
2018-02-10 05:35:08 (DEBUG):

and also this on BTCUSD: 
18-02-10 05:35:12 (DEBUG): Querying trades with: trades/tBTCUSD/hist?limit=1000&start=1509624081000&end=1509710481000
2018-02-10 05:35:13 (DEBUG): Processing 4108 new trades. From 2017-11-03 12:00:01 UTC to 2017-11-03 14:00:00 UTC. (2 hours)
2018-02-10 05:35:16 (DEBUG): Querying trades with: trades/tBTCUSD/hist?limit=1000&start=1509638400000&end=1509724800000
2018-02-10 05:35:19 (DEBUG): Querying trades with: trades/tBTCUSD/hist?limit=1000&start=1509637527000&end=1509723927000
2018-02-10 05:35:21 (DEBUG): Querying trades with: trades/tBTCUSD/hist?limit=1000&start=1509636706000&end=1509723106000
2018-02-10 05:35:24 (DEBUG): Querying trades with: trades/tBTCUSD/hist?limit=1000&start=1509635805000&end=1509722205000
2018-02-10 05:35:27 (DEBUG): Querying trades with: trades/tBTCUSD/hist?limit=1000&start=1509634466000&end=1509720866000
2018-02-10 05:35:29 (DEBUG): Querying trades with: trades/tBTCUSD/hist?limit=1000&start=1509633563000&end=1509719963000
2018-02-10 05:35:32 (DEBUG): Querying trades with: trades/tBTCUSD/hist?limit=1000&start=1509633118000&end=1509719518000
2018-02-10 05:35:32 (DEBUG): [bitfinex.js] (getTrades) returned an error, retrying: StatusCodeError: 429 - ["error",11010,"ratelimit: error"]
2018-02-10 05:36:42 (DEBUG): [bitfinex.js] (getTrades) returned an error, retrying: StatusCodeError: 429 - ["error",11010,"ratelimit: error"]
2018-02-10 05:38:09 (DEBUG): Querying trades with: trades/tBTCUSD/hist?limit=1000&start=1509632411000&end=1509718811000
2018-02-10 05:38:11 (DEBUG): Querying trades with: trades/tBTCUSD/hist?limit=1000&start=1509631730000&end=1509718130000

what all these errors means? 
does it just work now for BTCUSD but ETHUSD not? am I doing sthing wrong?

thanks again in advance for the wonderful support here... 

Derbeweis
  Reply
#5
The errors with binance comes from the fact hat binance is down.

> [bitfinex.js] (getTrades) returned an error, retrying: StatusCodeError: 429 - ["error",11010,"ratelimit: error"]

This means you are getting ratelimited, unfortunately this is a restriction from bitfinex and the only way around it is to use multiple servers (or multiple IP addresses). Do note that there is a technical (and currently undocumented way) to run multiple strats on the same pair by only polling the exchange once. The UI currently does this.

> 1. if I close the ssh windows, will it still work in the background on the server (all three) ?

There are a number of other ways to run Gekko not directly in the ssh shell (screen or pm2), however note that running Gekko in such ways is quite technical.
  Reply
#6
I know i prepared screen and can work good with it...
would love to see how I can walk round that restriction... if you have any explanation (even draft) for that way that the UI uses will be very thankful...
my coding and server years are way back (now just a simple QA IT Consultant with more PM roles and so) but still I can manage till now with the technical stuff Smile

thanks again.
  Reply
#7
Another question:

I managed actually a lot here, i can now use tmux and have multiple sessions parallel... i did more than one import and it was good.... now i starrten to try the backtest and ended up with this error:f

node gekko --config config_02.js --backtest

______ ________ __ __ __ __ ______
/ \ / |/ | / |/ | / | / \
/$$$$$$ |$$$$$$$$/ $$ | /$$/ $$ | /$$/ /$$$$$$ |
$$ | _$$/ $$ |__ $$ |/$$/ $$ |/$$/ $$ | $$ |
$$ |/ |$$ | $$ $$< $$ $$< $$ | $$ |
$$ |$$$$ |$$$$$/ $$$$$ \ $$$$$ \ $$ | $$ |
$$ \__$$ |$$ |_____ $$ |$$ \ $$ |$$ \ $$ \__$$ |
$$ $$/ $$ |$$ | $$ |$$ | $$ |$$ $$/
$$$$$$/ $$$$$$$$/ $$/ $$/ $$/ $$/ $$$$$$/

Gekko v0.5.12
I'm gonna make you rich, Bud Fox.


2018-02-10 20:59:15 (INFO):Setting up Gekko in backtest mode
2018-02-10 20:59:15 (INFO):
2018-02-10 20:59:15 (INFO):Setting up:
2018-02-10 20:59:15 (INFO): Trading Advisor
2018-02-10 20:59:15 (INFO): Calculate trading advice
2018-02-10 20:59:15 (INFO): Using the strategy: MACD
2018-02-10 20:59:15 (WARN):TALIB indicators could not be loaded, they will be unavailable.
2018-02-10 20:59:15 (INFO):

2018-02-10 20:59:15 (INFO):Setting up:
2018-02-10 20:59:15 (INFO): Paper Trader
2018-02-10 20:59:15 (INFO): Paper trader that simulates fake trades.
2018-02-10 20:59:15 (INFO):

2018-02-10 20:59:15 (INFO):Setting up:
2018-02-10 20:59:15 (INFO): Performance Analyzer
2018-02-10 20:59:15 (INFO): Analyzes performances of trades
2018-02-10 20:59:15 (INFO):



Gekko encountered an error and can't continue

Error:

History directory does not exist.



Meta debug info:

Gekko version: v0.5.12
Nodejs version: v9.5.0

Any idea why?

Where are my imports ??

Thanks
  Reply
#8
(02-10-2018, 08:05 PM)Derbeweis Wrote: Another question:

I managed actually a lot here, i can now use tmux and have multiple sessions parallel... i did more than one import and it was good.... now i starrten to try the backtest and ended up with this error:f

node gekko --config config_02.js --backtest

   ______   ________  __    __  __    __   ______
  /      \ /        |/  |  /  |/  |  /  | /      \
 /$$$$$$  |$$$$$$$$/ $$ | /$$/ $$ | /$$/ /$$$$$$  |
 $$ | _$$/ $$ |__    $$ |/$$/  $$ |/$$/  $$ |  $$ |
 $$ |/    |$$    |   $$  $$<   $$  $$<   $$ |  $$ |
 $$ |$$$$ |$$$$$/    $$$$$  \  $$$$$  \  $$ |  $$ |
 $$ \__$$ |$$ |_____ $$ |$$  \ $$ |$$  \ $$ \__$$ |
 $$    $$/ $$       |$$ | $$  |$$ | $$  |$$    $$/
  $$$$$$/  $$$$$$$$/ $$/   $$/ $$/   $$/  $$$$$$/

��������Gekko v0.5.12
��������I'm gonna make you rich, Bud Fox.


2018-02-10 20:59:15 (INFO):�����Setting up Gekko in backtest mode
2018-02-10 20:59:15 (INFO):
2018-02-10 20:59:15 (INFO):�����Setting up:
2018-02-10 20:59:15 (INFO):������������� Trading Advisor
2018-02-10 20:59:15 (INFO):������������� Calculate trading advice
2018-02-10 20:59:15 (INFO):������������� Using the strategy: MACD
2018-02-10 20:59:15 (WARN):�����TALIB indicators could not be loaded, they will be unavailable.
2018-02-10 20:59:15 (INFO):

2018-02-10 20:59:15 (INFO):�����Setting up:
2018-02-10 20:59:15 (INFO):������������� Paper Trader
2018-02-10 20:59:15 (INFO):������������� Paper trader that simulates fake trades.
2018-02-10 20:59:15 (INFO):

2018-02-10 20:59:15 (INFO):�����Setting up:
2018-02-10 20:59:15 (INFO):������������� Performance Analyzer
2018-02-10 20:59:15 (INFO):������������� Analyzes performances of trades
2018-02-10 20:59:15 (INFO):



Gekko encountered an error and can't continue

Error:

History directory does not exist.



Meta debug info:

Gekko version: v0.5.12
Nodejs version: v9.5.0

Any idea why?

Where are my imports ??

Thanks

I found it :Smile The candle.writer was off Sad(


Now a really hard question for me :Smile 

In the config files when you sepeiciy the   Candelsize and the history size... are these in minutes?
So 10 is 10 min?

then, does it affect the import? (I assume not, but i am not sure) so if I imort a year with these settings on 1 and 1 
And then in the paper trade i use 10 or 5 or 15, they all can use the same import right?

Last question: when i run a new strategy from CL do i have to build the Tombl file also? Or can I just have the settings in the strategy?

Thanks a lot..
  Reply
#9
> In the config files when you sepeiciy the Candelsize and the history size... are these in minutes?

Yes.

> would love to see how I can walk round that restriction...

You can start one simple Gekko configured to watch a realtime market and store all candles in a database, you can run two other gekkos that periodically poll this database to see if the first watcher has new candles. Setting up the first gekko is easy, the other ones you need to run with type "leech" (which means leech from a running market watcher). Documentation here is a bit outdated so unfortunately the easiest way to figure out the exact config syntax is to start a stratrunner in the UI and observe the API communication (via chrome developer tools - network tools or so).
  Reply
#10
Thanks... sounds great...

2 more Qs ? Smile i hope you are not annoyed by me yet Smile

1. Again.. does the candelsize on the import make a diffent for the candle size in the backtest?

2. If I am running Gekko on a server mainly from terminal ssh, can i also run it on the browser sometimes (with the cloud setup you have in the docu) to make some test ?

Thanks a lot....
  Reply


Forum Jump:


Users browsing this thread: