askmike / gekko

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

Best trading method [POLL] #610

Closed albertolive closed 6 years ago

albertolive commented 7 years ago

Hi!

I was wondering which is your preferred trading strategy. Do you use one of this list or do you use a custom one?

And what profits did you have since starting this strategy.

Jorman commented 7 years ago

I'm pretty new, and I don't really know how to set-up my personal strategy. Usually I import some months of data and I try with different settings. Btw I don't know if is the best approach, because I noticed that If I run some test with some months history I got a results and if I run the test with same settings with some days history I got a totally different results.

So Is difficult to me know what is the best settings? Crypto are very floating! Maybe I test CCI for 4 days is good, and for 2 months not! So, what is the best? Do test for some months and then use it to start and leave running (maybe for months)? Or do test for some days and then run for a short period of time? What do you think about it?

thegamecat commented 7 years ago

Get data then run back tests with different indicators, then write your own indicators.

Jorman commented 7 years ago

Personally I don't know how do it.

askmike commented 7 years ago

This is not investment advice

In my experience TA is a combination of experimenting blindly with different indicators (and their settings, as well as candleSize) and looking at charts trying to find patterns (the human brain is very good at finding patterns when looking at things, but it's hard to tell whether the patterns you found are real or not).

For example, if you look at this price chart:

https://bitcoinwisdom.com/markets/bitfinex/btcusd

if you click on 6h at the top and select EMA after settings. You'll see the price (candles) and two lines. If you would have bought everytime the blue line was above the orange one and sold the other way around you would have made a good profit. But, it's hard to tell if you would have made more if you just bought it at the beginning and sold it at the end (the market is going up, everyone is making money). This is the part that Gekko can automate in a backtest :)

decoye commented 7 years ago
img_3235

I call it line art

Suko commented 7 years ago

@decoye - a challenge for you, can you set up your method for "backtest" for time range between 1.6.2016 - 1.9.2016, I am curious if you will get a similar result.

decoye commented 7 years ago

No one said I got that result. Im assuming I cant get it as you pose it as a challenge.

But lets say I take it. Whats there to win mate?

Suko commented 7 years ago

I am just curious if your system works also when price trend is down and if it does and you pass the challenge I am willing to give you some money to test it live :)

decoye commented 7 years ago

Haha :)

Well I was not into bitcoin trading in that time period. I choose this time frame for my startend to test because I considered it to be the hardest time frame in bitcoin history by my research.

I don't want to take your money at all. And the unfortunate thing is that my life requires me to travel a lot, like it is right now. But if you can provide me with the dB for your time frame and upload it somewhere so I can download it, im happy to try my strategy for you. What I much rather like to request is a nice dinner and a good discussion when ever im in your city where ever that is. I'm sure that bitcoin people pose for very interesting discussions.

Suko commented 7 years ago

Ok done, if you will be around Berlin (Germany) let me know and I will invite you for a dinner! I am always willing to meet with interesting people.

No need to do the backtest, I was just curious how you manage to get results, that's all. Let's stop now spamming this thread :)

askmike commented 7 years ago

Ok done, if you will be around Berlin (Germany) let me know.

I was there last month (proof)! Will be there again soon!

I was just curious how you manage to get results

I want to publish the UI and backtester as soon as possible, and hope people will share more and more of their backtest results :)

decoye commented 7 years ago

I would love that mike. My problem is, I use a very old version of gekko because I cant get gekko dev in its currentform to run. So many things have changed that I cant get it to run and I have no time to figure it out.

decoye commented 7 years ago

My agency is berlin based, so im there quite often. I would love to hang out. Will let you know the next time. Mike shall also give a heads up!

I cant find the db, where did you upload it? I cant create it for myself as I'm mostly on mobile internet here...

decoye commented 7 years ago
bildschirmfoto 2017-03-13 um 10 36 03

interesting.

decoye commented 7 years ago

Suko, i could not withstand your challenge.

so for the timeframe you have setup the strategy ive used before produces the following theoretical results.

bildschirmfoto 2017-03-12 um 11 53 27
albertolive commented 7 years ago

@decoye could you explain which method did you use? Thanks!

decoye commented 7 years ago

:D im pretty sure that you wont create considerable and reliable results at least not over a long time. but sure.

here is my cci method for bitcoin against namecoin.

in the timeframe displayed you would have made 414%. That is 104% more profit than buy and hold.

send me 10% of the profits that you could gather with this strategy here ;)

36aCpRVWKu1uHG9MKthHGRndnFmuLwQsgL

bildschirmfoto 2017-03-15 um 18 06 20

Candle size 17 history 10

constant = 0.015 history = 90

[thresholds] up = 160 down = -10

generalectric commented 7 years ago

screenshot_2017-03-15-12-14-18

btc_bela using adx roc rsi macd stddev sma

tregismoreira commented 7 years ago

@generalectric How did you put it all together?

generalectric commented 7 years ago

custom method added several talib indicators then made rules for long and short. There's a page on here somewhere that shows how to add talib indicators

generalectric commented 7 years ago

https://github.com/askmike/gekko/blob/stable/docs/trading_bot/talib_indicators.md

Zep18 commented 7 years ago

Using CCI like @decoye, with the following parameters (With a > 2 year dataset) : image

Just launch the bot with an initial balance of 100€ and this config on Kraken EUR/XBT, I'll update with result

decoye commented 7 years ago

@zep18 cheers.

tuxitor commented 7 years ago

This doesn't look like a good idea: gekkoui-03

justinkheisler commented 7 years ago

Is there documentation on how the actions are tracked. Similar to Decoye's chart, it seems to buy many times without a sell happening during backtesting. Does it buy using the full currency amount thus not having anything to make the second 'buy' with, or does it only use a part of the total currency amount for each buy?

Sorry if this is in the docs, would appreciate being pointed in the right direction.

askmike commented 7 years ago

Is there documentation on how the actions are tracked. Similar to Decoye's chart, it seems to buy many times without a sell happening during backtesting.

Ideally a strategy will only advice a sell after a buy (and vice versa). A lot of strategies were added by other people, and sometimes these strategies advice the same information twice (this is not really what is supposed to happen). I'll try to fix these at some point.

Does it buy using the full currency amount thus not having anything to make the second 'buy' with.

Yes exactly, the second buy doesn't change anything.

--

These things are not exactly documented, so if you have any questions feel free to ask :)

justinkheisler commented 7 years ago

Ok perfect, thanks a lot Mike.

decoye commented 7 years ago

id like to ask how you can make a strategy that checks for percentages up/down.

lets say like, 2% down long, 2% up short.

askmike commented 7 years ago

So you mean if the price goes like this:

100 -> 101 -> 102 -> 103

It's up 1% each candle?


That's called Rate of Change, which is not hard to calculate yourself. Or if you are using talib you can use the talib indicator ROC.

ak9250 commented 7 years ago

@Zep18 any results from that bot so far?

talvasconcelos commented 7 years ago

@decoye can you explain the values from the strategy above? I have a hard time understanding what do the key/value pairs of the strategies mean... Is there any good documentation on those values?

askmike commented 7 years ago

@talvasconcelos are you referring to the CCI method? You can find the documentation of the strategy as implemented in Gekko here:

https://gekko.wizb.it/docs/strategies/example_strategies.html#CCI

What the different values of CCI represent can be found here: ~http://www.investopedia.com/terms/o/overbought.asp~ better link here: http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:commodity_channel_index_cci

andreialecu commented 7 years ago

Does it buy using the full currency amount thus not having anything to make the second 'buy' with. Yes exactly, the second buy doesn't change anything.

@askmike looks like that isn't 100% true, something is wrong with the CCI indicator with the configuration posted above by @decoye

image

If you look at roundtrips, you can see multiple entries at the exact same date and time, but different exits. I don't think that is supposed to happen, and it skewes backtests considerably making the results downright broken. There's also a discrepancy between the Exit Balance and Entry Balance following it.

shanehull commented 7 years ago

Has anyone had any luck with talib-macd? Is it any "smarter" than your standard TA's?

I've been playing around and watching BTC/XMR and USDT/XMR with both RSI and TSI and although the backtests give me results of %100+ profit with clear buy and sell indicators on the lows and highs, it's far too quick to make trades when live (it generally goes short when there's about a 2-3% increase in price but plenty of room to move up). Obviously backtests aren't any indication of what's to happen, but I expected my strategy to at least make a couple of good simulated trades.

fseixas commented 7 years ago

CCI is such a versatile indicator.

But don't think you can find a config that will work in any market condition.

You should have a config for "good times" and another for "bad times".

The basics are the following: In Good Times use: -Higher up thresholds (means the bot will wait for higher profits. I like to use 150) -Higher down thresholds (means the bot will use smaller stop loss. I like to use -30) -Bigger candle sizes (means the bot will wait more to decide what to do. I like to use 30 or 40 minutes candles)

In Bad Times use: -Limited up thresholds (means the bot will take small profit more often. I like to use 60) -Lower down thresholds (means the bot will accept a bigger down variation-lower stop loss. I like to use -150) -Smaller candle size (means the bot will decide what to do more often. I like to use 20 minutes)

The trader has to decide when to switch from one config to the other one. And some good old TA on the graphics will help.

Disclaimer: This is not an investment advice. These settings worked for me in the USDT/BTC market.

chrisedington commented 7 years ago

@fseixas thanks for the insight!

To set your candle size to 30, do you do this? config.tradingAdvisor = { enabled: true, method: 'CCI', candleSize: 30, historySize: 1, adapter: 'sqlite', talib: { enabled: false, version: '1.0.2' } }

and

config.CCI = { constant: 0.015, history: 30, thresholds: { up: 120, down: -30, persistence: 0 }

The fact that there are two history numbers confuses me.. Would love some advice :)

Do you also have a "0" for persistence?

fseixas commented 7 years ago

@chriscapetown the history in the config.cci is the timeframe for calculating the CCI indicator. go with the default. The history in the config.tradingadvisor is the timeframe the advisor will look to decide thinks like the trend. It depends if the strategy uses such history or not.

In the case of CCI, 1 will do just fine.

And yes, keep persistence = 0

chrisedington commented 7 years ago

Got you. Thanks!

EasyAsABC123 commented 7 years ago

is there a website people share their trading strategies, for free or paid subscription? I won't be surprised if people would pay for assistance from experienced users

cbwang2016 commented 6 years ago

@generalectric How did you combine adx, roc, rsi, macd, stddev and sma all together? Did you just do a linear combination of them or use some algorithm?

thegamecat commented 6 years ago

In your strat add all the indicators you want to use and then base trading logic upon them.

cbwang2016 commented 6 years ago

@generalectric So what's your trading logic

EasyAsABC123 commented 6 years ago

@cbwang2016 trading logic isn't normally openly shared because it is like him saying this will make you money...and it is just his opinion there isn't a master formula to making money or we'd all be billionaires and money would be worthless.

daisy613 commented 6 years ago

Has anyone tried to do something complex, like EWT on Gekko?

vladeta commented 6 years ago

Did anyone create PAMR strategy?

reddog01ro commented 6 years ago

HY I AM NEW here. I want to use DEMA strategy with few minor changes. I want to put a by order when crossing ema, and after that I want to wait for sell even if the condition to sell is triggered, so I want to sell only when the price is higher that I by it. after that if I am in uptrend put again a by order and repeat the algoritm. Do you thing that this can be done?

omega733 commented 6 years ago

Hi i make good bt but in reality with poloniex for example The forward test not work not work like BT ...

Do somone have experiance with others pairs?

i test only 1 month ... BUT is My own strategie !!! I call it BB

bb

btc vs dooge

my own strategie

weshweshwesh commented 6 years ago

With Doge on Ploniex, all is possible ^^

sans titre

gvdhoven commented 6 years ago

@weshweshwesh willing to share the code from your strategy so we can all learn and benefit?

omega733 commented 6 years ago

Hi this is based on My btc vs dooge but only BT back test are good in reality is not same !!

for moment i stay on forex regards