Skip to content

Commit

Permalink
ZERO filter much more agressive (buys less often)
Browse files Browse the repository at this point in the history
This is a tweak to the MACD sanity check logic:

This ZERO-lag MACD is a momentum trading method,
this update re-tunes one of the signal filters

The momentum signal is still the main one :)

Details:

The initial "proof of concept" required price
to be at or better than 25th percentile to buy...

Changed price filtering to "better than 12th~ish"

phrased another way:

75% of the time the price WAS flagged "too high"
versus 87.7274659713 percent for the new version
  • Loading branch information
Sarah White committed Jul 16, 2014
1 parent a9c8a94 commit b4cae1b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion methods/ZERO.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ method.log = function() {
// historical stats for the sanity checking window:
log.debug('\t', 'VWAP:', windowstats.vwap.toFixed(digits));
log.debug('(percentiles) window stats:');
log.debug('\t', '1st:', windowstats.p1st.toFixed(digits));
log.debug('\t', '5th:', windowstats.p5th.toFixed(digits));
log.debug('\t', '10th:', windowstats.p10th.toFixed(digits));
log.debug('\t', '12th~ish:', windowstats.pFancyEighth.toFixed(digits));
log.debug('\t', '25th:', windowstats.p25th.toFixed(digits));
log.debug('\t', '40th:', windowstats.p40th.toFixed(digits));
log.debug('\t', 'median:', windowstats.p50th.toFixed(digits));
Expand All @@ -52,6 +54,7 @@ method.log = function() {
// log.debug('\t', '75th:', windowstats.p75th.toFixed(digits));
// log.debug('\t', '90th:', windowstats.p90th.toFixed(digits));
// log.debug('\t', '95th:', windowstats.p95th.toFixed(digits));
// log.debug('\t', '99th:', windowstats.p99th.toFixed(digits));

log.info('\t', '[shortEMA]CLOSE:', zero.shortC.result.toFixed(digits));
log.info('\t', '[longEMA]CLOSE:', zero.longC.result.toFixed(digits));
Expand All @@ -73,7 +76,7 @@ method.check = function() {
var divination = macd + crystalball;
var filtered = Math.min(macdiff, divination);

if ((filtered >= minup) && (macd <= crystalball) && (signal < 0) && (windowstats.vwap <= windowstats.p25th)) {
if ((filtered >= minup) && (macd <= crystalball) && (signal < 0) && (windowstats.vwap <= windowstats.pFancyEighth)) {

// new trend detected
if(this.trend.direction !== 'up') {
Expand Down

0 comments on commit b4cae1b

Please sign in to comment.