askmike / gekko

A bitcoin trading bot written in node - https://gekko.wizb.it/
MIT License
10.08k stars 3.93k forks source link

Request: multi timeframes emit to strategy #762

Closed thegamecat closed 7 years ago

thegamecat commented 7 years ago

Hi again, Tomih posted something a while ago about his fork here: https://github.com/tomih/gekko which suggest we can use multiple time frames in 1 strategy. Is this something that be merged into the gekko Master?

I'm manually working with an effective strategy at the moment and would like to automate it but it does need the read across multiple time frames.

askmike commented 7 years ago

There are no plans for that, main reasons are that this goes against the main design principles of Gekko:

The idea of Gekko is that it is a simple starters kit for building TA strats, keeping simplicity is achieved by sacrificing more advanced (and complex) functionality that only a small portion of users would need but makes everything more confusing for everything else. Examples of this are:


Gekko is build modular so not to say it's not possible, just that I won't be supporting it (I won't add features that won't be accessible through the UI - and I don't think this is easy to add to the UI in a way that people actually understand what is going on).

More details on this specific topic can be found here: https://github.com/askmike/gekko/pull/737#issuecomment-299634318

askmike commented 7 years ago

That's not to say I am not open to PRs, if someone opens an issue to go into details on how to do this properly and than submits a PR that implements it (with the intention to keep it up to date as well) it might just land in Gekko at some point.

generalectric commented 7 years ago

@askmike, can we talk more about this? Ok so you do not want to implement multiple candlesize support due to the fact that it wouldnt be easily worked into the UI. Ok... fair enough. So cant we just write large candle strat to control small candle strat. Large candle strat instead of buy or sell would start or stop small candle strategy process and listen... then upon advice execute... Or... have the small candle strat just execute the advice then pass back the information to the parent process where it can be emitted as a trade for the ui. The problem is small candle strats have ups and downs... but they perform differently during the big candle ups and downs... So what you end up with is settings that are optimal over the entire spectrum... or settings that are overall optimal instead of settings that are geared toward a specific market trend. Now my small candle strat has settings for up and down trends... but it needs to have total different settings for those ups and downs based off of large candle indicators to maximize results. Any thoughts or considerations i should have going into this? I know i dont always take the right approach but if adding multi candlesize support to gekko isnt an option i think this is what im left with unless you have a better idea?

askmike commented 7 years ago

So cant we just write large candle strat to control small candle strat. Large candle strat instead of buy or sell would start or stop small candle strategy process and listen... then upon advice execute...

We can do this, but I am pretty sure this not very flexible as it only allows a few things out of what everyone wants.

The main thing is that if we are to implement something that allows different indicators to be specified in different candle sizes, we need to do it in a way that:

  1. is an understandable concept.
  2. is flexible enough so everyone can do whatever they want with it. I don't think your "one small strat + one big strat" would be flexible enough for everyone: a lot of people want 5 min, 15 min and 60 min candles in the same strat.

Any thoughts or considerations i should have going into this? I know i dont always take the right approach but if adding multi candlesize support to gekko isnt an option i think this is what im left with unless you have a better idea?

Just from a strategy point of view, I think this would make the most sense:

if you want different indicators in different candleSizes you go into something like an "advanced strategy mode" where Gekko forces 1 minute candles to your strategy, and inside your this.addIndicator you get to specify the candleSize for each indicator. As for triggering your strategy as to when something has changed we have two options:

  1. call the update and check function every time anything changed, leaving it up to the strat to figure out when to do something.
  2. have different update and check functions for each different candleSize.

I think using whatever way you should be able to implement what you want ("small strat" + "big strat").