WHAT IS that method in the DEMA.js? I do not know what that code even is. It is
not using a "
double EMA" of any kind, and I can't seem to find any sort of indicator based on that sort of algorithm. This is how it works:
~pseudocode~
Calculate a fast and slow EMA average
A = subtract one from the other
B = add one to the other, and divide it by 2
C = 100 times A divided B
based on the value of C, assume positive values mean an uptrend, and negative values mean a downtrend
I ... don't even know what that is. It is not called "DEMA" though I don't think, I've never seen any TA indicator which does that particular combination of things to two different EMAs...
I could have updated the ticket with more info after fixing the PPO code, but was tired last night... PPO has been audited and is now consistent with the new codebase, and I added the x2MACD now as well (
which worked correctly overnight) -- updated:
https://github.com/kuzetsa/gekko/issues/3 maybe you still have not found it, but it is in gekko documentation:
### DEMA
This method uses `Exponential Moving Average crossovers` to determine the current trend the
market is in. Using this information it will suggest to ride the trend. Note that this is
not MACD because it just checks whether the longEMA and shortEMA are [threshold]% removed
from eachother.
This method is fairly popular in bitcoin trading due to Bitcointalk user Goomboo. Read more about this method in [his topic](https://bitcointalk.org/index.php?topic=60501.0)
You can configure these parameters for DEMA in config.js:
config.DEMA = {
// EMA weight (α)
// the higher the weight, the more smooth (and delayed) the line
short: 10,
long: 21,
// amount of candles to remember and base initial EMAs on
// the difference between the EMAs (to act as triggers)
thresholds: {
down: -0.025,
up: 0.025
}
};
- short is the short EMA that moves closer to the real market (including noise)
- long is the long EMA that lags behind the market more but is also more resistant to noise.
- the down treshold and the up treshold tell Gekko how big the difference in the lines needs to be for it to be considered a trend. If you set these to 0 each line cross would trigger new advice.