-
Notifications
You must be signed in to change notification settings - Fork 2k
Strategies: TA (ema+macd) and Trust/Distrust #285
Conversation
Please note that the TA is still WIP, i'm planning to work on it a bit further at the end of this week. as you can see, with the MACD it processes ALL data to TAlib. with the EMA only the last x periods are fed. As well i found that at leased for MACD the data seems to be 1 period off and i dont know why yet. this needs more testing. |
@Fjuxx noted! This is why I added them as separate |
Perfect, when i start again i will work from this branch (or if it is merged from master ofc) |
@@ -32,6 +32,7 @@ | |||
"semver": "^5.3.0", | |||
"sosa_mongo": "^1.0.3", | |||
"timebucket": "^0.4.0", | |||
"talib": "^1.0.3", |
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.
FYI, Talib doesnt work on Windows:
npm ERR! notsup Unsupported platform for [email protected]: wanted {"os":"darwin,linux","arch":"any"} (current: {"os":"win32","arch":"x64"})
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.
Although, yes, that sucks, TA-Lib has many indicators and many financial functions that might be of use. This could be a case where I'd say that we drop Windows support.
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.
Just wanted to let you know. But I agree, VM on windows is easy
I'm noticing major slowdown in performance for the two |
description: 'Sell when price higher than $sell_min% and highest point - $sell_threshold% is reached. Buy when lowest price point + $buy_threshold% reached.', | ||
|
||
getOptions: function () { | ||
this.option('period', 'period length', String, '30m') |
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.
You're missing a min_periods
value here, which causes a NaN when trying to calculate the number of days to backfill here.
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.
I feel like this min_periods
shouldn't be part of the strategy, as it's needed in trade.js... but I added it, as I see that all other strategies, except for SAR, have also added it (but don't actually do anything with it).
Good catch!
I have same problem.so reset to previous commit. |
@arpheno yes, those are definitely WIP at this time. This is also the reason that they've gotten their own strategy name instead of replacing the current ema and macd. |
@nao0811ta I'm not sure what you're referring to, what signal is to null? |
node-gyp and node v8.x are not friends, stick to boron for now Rename talib's MACD (#2) * Rename talib's MACD so it doesn't overlap with original macd
if (s.trust_distrust_lowest > s.period.high) { | ||
s.trust_distrust_lowest = s.period.high | ||
} | ||
}, |
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.
note to self: might want to consider calculating EMA/MACD (both?) to check if we are in an up or down trend, and advise buy/sell accordingly.
currently we sell when we drop a certain percentage under the top, but if EMA/MACD says we are in an upward trend, it doesn't make sense to sell.
currently we buy when we grow a certain percentage above the deepest point, but if EMA/MACD says we are in a downward trend, it doesn't make sense to buy.
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.
Hi @DeviaVir, did you manage to implement this idea of yours?
@DeviaVir whats the status of this PR, seems like a good strategy for taking Max profit. |
@nibzo1 could definitely still use some more eyes, tweaks and other things. It also breaks the Windows version (by trying to install ta-lib) so I'm not merging unless I have contributor agreement at those pros and cons. |
Ok sure thing I might bull changes and give it a test run, I'm not a windows user so I wont be able to assist there. I can definitely do some sim's and even some live testing against the Kraken exchange and report back any odd behavior. |
I think the two ta_ strategies are so slow because the arrays used in the corresponding lib files grow rather large. Perhaps making the s.marketData just what is needed (close), instead of a multidimensional array, then slicing the last n that are needed into a new working array var will help |
@@ -0,0 +1,136 @@ | |||
var z = require('zero-fill') |
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.
Could you comment what exactly this strategy does at the top? What you wrote in the description of this pr would be really awesome.
My biggest mental blocker for this was Windows support. Which it looks like we have already broken, so I'm inclined to just merge this now and allow others to play with this in master. |
…os8f-master * 'master' of https://github.com/carlos8f/zenbot: Improve command help for train command (DeviaVir#436) Support for missing win/loss and error rate from output (DeviaVir#426) Fix docker builds for forex.analytics (DeviaVir#424) Minor fixes for Quadriga trading API (DeviaVir#421) xmpp for trading alarms (DeviaVir#333) Strategies: TA (ema+macd) and Trust/Distrust (DeviaVir#285) Fixed docker build (DeviaVir#349) updated c.default_selector to c.selector in README.md (DeviaVir#418) added check for message before doing anything with it (DeviaVir#412) FIX: Properly check for unknown indicators in forex_analytics (DeviaVir#408) Added support for the BTCe exchange (DeviaVir#388) Add strategy: forex.analytics, an genetic optimization algorithm for TA-lib stats (DeviaVir#389) # Conflicts: # .gitignore # commands/sim.js # extensions/exchanges/bittrex/exchange.js # extensions/exchanges/quadriga/exchange.js # lib/engine.js # scripts/auto_backtester/backtester.js
node-gyp and node v8.x are not friends, stick to boron for now Rename talib's MACD (DeviaVir#2) * Rename talib's MACD so it doesn't overlap with original macd
This TA is a copy of the work @Fjuxx has been doing, since it's a separate strategy, I don't think there's a harm in including it already.
The trust/distrust can be described as follows:
Trust/Distrust is best used with (expected) growing altcoins. Trust/Distrust is nice if you don't want the bot to ever make a negative trade (although you can configure the
sell_threshold_max
which is the percentage below at which the bot will panic sell)Here are some results from trust/distrust:
vs a not super fast growing market (these params should be further tuned):
another not fast growing market:
(
trend_ema
balance for the above market:end balance: 1358.10164583 (-2.99%)
)