@@ -98,42 +98,42 @@ exports.getFilterFn = function(direction) {
9898 switch ( direction ) {
9999 case 'increasing' :
100100 return function ( o , c , isPrevThisDirection , oprev , cprev ) {
101- if ( o == c ) {
102- if ( c > cprev ) {
103- return true // increasing
104- } else if ( c < cprev ) {
105- return false // decreasing
101+ if ( o === c ) {
102+ if ( c > cprev ) {
103+ return true ; // increasing
104+ } else if ( c < cprev ) {
105+ return false ; // decreasing
106106 } else {
107- if ( isPrevThisDirection === true ) {
108- return true // determine by last candle
109- } else if ( isPrevThisDirection == false ) {
110- return false // determine by last candle
107+ if ( isPrevThisDirection === true ) {
108+ return true ; // determine by last candle
109+ } else if ( isPrevThisDirection = == false ) {
110+ return false ; // determine by last candle
111111 } else {
112- return true // If we don't have previous data, assume it was increasing
112+ return true ; // If we don't have previous data, assume it was increasing
113113 }
114114 }
115115 }
116- return o < c ;
116+ return o < c ;
117117 } ;
118118
119119 case 'decreasing' :
120- return function ( o , c , isPrevThisDirection , oprev , cprev ) {
121- if ( o == c ) {
122- if ( c > cprev ) {
123- return false // increasing
124- } else if ( c < cprev ) {
125- return true // decreasing
120+ return function ( o , c , isPrevThisDirection , oprev , cprev ) {
121+ if ( o === c ) {
122+ if ( c > cprev ) {
123+ return false ; // increasing
124+ } else if ( c < cprev ) {
125+ return true ; // decreasing
126126 } else {
127- if ( isPrevThisDirection === true ) {
128- return true // determine by last candle
129- } else if ( isPrevThisDirection == false ) {
130- return false // determine by last candle
127+ if ( isPrevThisDirection === true ) {
128+ return true ; // determine by last candle
129+ } else if ( isPrevThisDirection = == false ) {
130+ return false ; // determine by last candle
131131 } else {
132- return false // If we don't have previous data, assume it was increasing
132+ return false ; // If we don't have previous data, assume it was increasing
133133 }
134134 }
135135 }
136- return o > c ;
136+ return o > c ;
137137 } ;
138138 }
139139} ;
0 commit comments