# all files / technicalindicators/lib/candlestick/ GraveStoneDoji.js

100% Statements 10/10
100% Branches 2/2
100% Functions 2/2
100% Lines 10/10

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    211×

    1×
    1×

    1×
    1×
    1×

    1×
    1×

    1×

    1×const CandlestickFinder = require('./CandlestickFinder.js');

    class GraveStoneDoji extends CandlestickFinder {
        constructor() {
            super();
            this.requiredCount  = 1;
            this.name = 'GraveStoneDoji';
        }
        logic (data) {
            let daysOpen   = data.open[0];
            let daysClose  = data.close[0];
            let daysLow   = data.low[0];

            let isOpenEqualsClose     = this.approximateEqual(daysOpen, daysClose);
            let isLowEqualsOpen      = this.approximateEqual(daysOpen, daysLow);

            return (isOpenEqualsClose && isLowEqualsOpen);
        }
    }

    module.exports = GraveStoneDoji;