askmike / gekko

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

All of the strategies are calculated wrong #989

Closed tomtom87 closed 7 years ago

tomtom87 commented 7 years ago

Note: for support questions, please join our Discord server

Without giving away too much, the reason these strategies constantly loose is they are not trading how these strategies should they are just nonsense.

First of all try to make the golden cross / death cross strat with a trailing ATR based stop.

pelletencate commented 7 years ago

I wrote my strategy both in JS and in Pine Script (so I can see it work on tradingview.com). Just one single strategy. And I can already say that your statement in this title is simply incorrect. My strategy is calculated 100% correctly.

Which means that you need to be more specific as to what you're seeing. Also, RTFM. If your expected result is profit and you consider not getting it to be a bug, you clearly didn't. :-)

tomtom87 commented 7 years ago

@pelletencate the DEMA strategy, what are you trying to do here? No offense but its nothing man.

Let's be honest - this is profitable for you?

I am creating expert advisors for MT4 for several years, and the way these strats are made are interesting - quiet different really. But I do not see them making any profit :)

tomtom87 commented 7 years ago

In pseudo we need the equivalent of:

ma1before < ma2before && ma1now > ma2now

.. death cross.. ma1 has moved above ma2

Detection of just ma1 < ma2 or if there is a gap between them isn't something Ive ever heard to trade on anywhere, but please enlighten me mate. For me I tested these strategies given here during the recent bull run and they lost consistently... were as my MT4 was much better suited.

tomtom87 commented 7 years ago

Looking at the dema example I don't see how this can ever could work really.

So If the trend is up we buy, and if its down we close. That's really working?


    if(this.currentTrend !== 'up') {
      this.currentTrend = 'up';
      this.advice('long');
    } else
      this.advice();

  } else if(diff < settings.thresholds.down) {
    log.debug('we are currently in a downtrend', message);

    if(this.currentTrend !== 'down') {
      this.currentTrend = 'down';
      this.advice('short');
    } else
      this.advice();
shanehull commented 7 years ago

As the docs say, they're example strategies. If you have ideas on how to improve them, submit a PR! We'd love to see the results.

tomtom87 commented 7 years ago

Ok, if that's cool I will do just that then!

Like the cci and macd examples, this is not how we use these indicators. I am a technical analyst and honestly guys this just will not profit. You need to calculate crosses.

First thing we need is a function for detectCross with 2 or 4 arguments, depending if it is divergence or just a level crossing..

detectCross(before1, before2, now1, now2) or detectCross(now1, now2);

tomtom87 commented 7 years ago

Additionally you will need a trail stop method, you can't just jump out of the trade because slope changed (these algorithms are just slope based trends)

Some indicators like MACD are wide ranging meaning looking for a upper threshold is futile between instruments e.g during a rally macd may extent to high 300 numbers, so setting 100 as a top would be impractical in that setting. This is why it's best to monitor divergence via a cross in my experience.

askmike commented 7 years ago

All of the strategies are calculated wrong

Strategies don't calculate anything, they are just wrappers around indicators that signal based on calculated output. As stated above, they are merely examples.

  • Additionally you will need a trail stop method
  • for a upper threshold is futile between instruments e.g during a rally macd may extent to high 300 numbers
  • the DEMA strategy, what are you trying to do here? No offense but its nothing man.
  • Like the cci and macd examples, this is not how we use these indicators.
  • First thing we need is a function for detectCross
  • I am a technical analyst and honestly guys this just will not profit. You need to calculate crosses.

All these things have 0 to do with any calculations and are just your opinion. As stated above the strategies that come with Gekko are simple examples. Gekko is a framework to build your own strategies.

thegamecat commented 7 years ago

I'm a rocket scientist. Gekko wont take you to the moon.

Have a great day.

AdityaNayak commented 6 years ago

@tomtom87 Have the same opinion. Perhaps a better set of example strategies is what we need.

askmike commented 6 years ago

You are more than welcome to submit a PR for a strategy.

On 21 Sep 2017 19:44, "AdityaNayak" notifications@github.com wrote:

@tomtom87 https://github.com/tomtom87 Have the same opinion. Perhaps a better set of example strategies is what we need.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/askmike/gekko/issues/989#issuecomment-331230200, or mute the thread https://github.com/notifications/unsubscribe-auth/AA7MDwS-35qDdqkOlZVV_PccCmaO9NtBks5skqBcgaJpZM4O5p8Y .

AdityaNayak commented 6 years ago

Yes, will do. Trying to get to my first profitable strategy at the moment.

@askmike Awesome job with the bot so far. It is rare to find such good documentation.

tomtom87 commented 6 years ago

Im already profit in my algorithm and very busy to write one for you.

Just wanted to let you guys know why this looses money. Best you read technical indicators from the CFTe course and learn how each works.

You do slope calculations and spread - its total fubar in real trading we dont do it like that. Also your code is one way only bull market you cannot short. So really its like gunbot but doesnt work.

At least code a real MA strat you can make a few pips a trade that way.

Good luck

On 22 Sep 2017, at 00:46, Mike van Rossum notifications@github.com wrote:

You are more than welcome to submit a PR for a strategy.

On 21 Sep 2017 19:44, "AdityaNayak" notifications@github.com wrote:

@tomtom87 https://github.com/tomtom87 Have the same opinion. Perhaps a better set of example strategies is what we need.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/askmike/gekko/issues/989#issuecomment-331230200, or mute the thread https://github.com/notifications/unsubscribe-auth/AA7MDwS-35qDdqkOlZVV_PccCmaO9NtBks5skqBcgaJpZM4O5p8Y . — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.