Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

All of the strategies are calculated wrong #989

Closed
tomtom87 opened this issue Aug 17, 2017 · 13 comments
Closed

All of the strategies are calculated wrong #989

tomtom87 opened this issue Aug 17, 2017 · 13 comments

Comments

@tomtom87
Copy link

Note: for support questions, please join our Discord server

  • I'm submitting a ...
    [x] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository

  • Action taken (what you did)
    Used Gekko

  • Expected result (what you hoped would happen)
    Profit money

  • Actual result (unexpected outcome)
    Lost money

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc)
    A cross is detected by 3 sample points traditionally in algorithm trading. You would benefit from looking at working algorithms and writing them into your JS from MQL4 for example.

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
Copy link
Contributor

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
Copy link
Author

@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
Copy link
Author

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
Copy link
Author

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
Copy link

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
Copy link
Author

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
Copy link
Author

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
Copy link
Owner

askmike commented Aug 17, 2017

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
Copy link

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

Have a great day.

@AdityaNayak
Copy link

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

@askmike
Copy link
Owner

askmike commented Sep 21, 2017 via email

@AdityaNayak
Copy link

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
Copy link
Author

tomtom87 commented Sep 22, 2017 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants