-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Conversation
This is a basic BB strategy: It advice long when candle close price enter into the band from a lower value. On the other side it advice a short position when the candle close price enter into the band from a top value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Readability recommendation. Multiple statements could be added to one if block or a switch statement.
else { | ||
// There is a zone change | ||
log.debug('Leaving zone: ',this.trend.zone) | ||
if (this.trend.zone == 'top') this.advice('short'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than two different if statements where the zone equals the same, why not?
if (this.trend.zone === 'top') {
log.debug('>>>>> SIGNALING ADVICE SHORT <<<<<<<<<<<<');
this.advice('short');
}
Perhaps a switch
statement would be more readable?
Thanks a lot for your excellent work! Here are some customizations to your strategy indicator "bb.js" Formula: http://vtadwiki.vtad.de/images/math/c/cd/cdbe5ac0c968565ba093b8add6766bd2.png // no required indicators var Indicator = function(BBSettings) { Indicator.prototype.update = function(price) { var tail = this.prices[this.age] || 0; // oldest price in window this.prices[this.age] = price; // your code: // your code: // your code: this.upper = this.middle + this.settings.NbDevUp * stdev; this.age = (this.age + 1) % this.settings.TimePeriod; } |
@okibcn @hand0722 why not use the Tulind indicator: BBands? Besides the fact that writing your own indicators is fun, what is the profit of using yours above the Tulind indicator? |
I can’t get talib Bollinger bands to work. I always get errors.
I have no working talib Bollinger bands strategy / indicator pair that is working at UI with a toml-file.
I tried to create these files (#1275) , I invested really a lot of time, but I cant I can’t get talib bollinger bands to work … ☹
Alternatively I found the three scripts of okibcn . It was no problem to get them to work.
After analyzing the code I found (in my opinion) a little mistake in it (better building a math.sqrt over the whole expression) and posted it. So the profit is that the own written version works 😊
Today I tried to get run the talib version again. After four hours, in vain, I give it up.
Cheers
|
Forgive my noob-ish-ness, but What exactly (steps) do I need to do to add this to Gekko? And can I access it via the html UI? I added the3 files above in their respective folders, but the strategy does not appear in the web UI. Is there anything else I need to do to make it work? Thanks! |
OK, update - I got it to appear in the UI, but it won't seem to run. When I try to do a backtest, I get: 2018-01-27 17:42:43 (INFO): Setting up Gekko in backtest mode ((note: the carat symbol is underneath the second "*" - it won't show properly in comments)) SyntaxError: Unexpected token * Error: non-error thrown: Child process has died. |
You are using the original version of Okibcn’s implementation of BB.js strategy file.
However, the notation “**” is not supported by your (and also my) javascript installation or javascript interpreter.
Instead of:
this.sumsq += this.diffs[this.age] ** 2 - diffsTail ** 2;
you can use following notations:
this.sumsq += this.diffs[this.age] * this.diffs[this.age] - diffsTail * diffsTail;
or:
this.sumsq += Math.pow(this.diffs[this.age], 2) - Math.pow(diffsTail, 2);
Otherwise you can use my customized indicator file.
cheers
|
@okibcn hey! Apologies for the delay. This looks awesome and I've love to include this. Would you mind adding a test case like this one for the MACD indicator? |
man i using this strategy and its always work your method work as soon as the candle hit the upprBB you will sell , but sometimes the candle hit the upperBB with lower price than the buying price . so you have to compare prices , |
Sorry for a stupid question, Is anyone able to explain to me precisely what the variables mean? For example, what does nbdevup compare against exactly? Is it the amount that the last candle went above thetop BB? is it $? is is %? |
A test case for BB:
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If you feel this is very a important issue please reach out the maintainer of this project directly via e-mail: gekko at mvr dot me. |
This is a basic BB strategy:
It advice long when candle close price enter into the band from a lower value. On the other side it advice a short position when the candle close price enter into the band from a top value.
A new feature
What is the current behavior? (You can also link to an open issue here)
What is the new behavior (if this is a feature change)?
Other information: