@@ -133,7 +133,7 @@ function executeTulindIndicator(source, indicator, tulindOptions) {
133
133
134
134
module . exports = {
135
135
// indicators which source is Candles
136
- sourceCandle : [ 'cci' , 'pivot_points_high_low' , 'obv' , 'ao' , 'mfi' , 'stoch' , 'vwma' , 'atr' , 'adx' , 'volume_profile' , 'volume_by_price' , 'ichimoku_cloud' , 'zigzag' , 'wicked' , 'heikin_ashi' , 'psar' ] ,
136
+ sourceCandle : [ 'cci' , 'pivot_points_high_low' , 'obv' , 'ao' , 'mfi' , 'stoch' , 'vwma' , 'atr' , 'adx' , 'volume_profile' , 'volume_by_price' , 'ichimoku_cloud' , 'zigzag' , 'wicked' , 'heikin_ashi' , 'psar' , 'hma' ] ,
137
137
138
138
bb : ( source , indicator ) =>
139
139
executeTulindIndicator ( source , indicator , {
@@ -148,10 +148,17 @@ module.exports = {
148
148
sma : ( ...args ) => executeTulindIndicator ( ...args , { options : { length : 14 } } ) ,
149
149
ema : ( ...args ) => executeTulindIndicator ( ...args , { options : { length : 14 } } ) ,
150
150
rsi : ( ...args ) => executeTulindIndicator ( ...args , { options : { length : 14 } } ) ,
151
- hma : ( ...args ) => executeTulindIndicator ( ...args , { options : { length : 9 } } ) ,
152
151
roc : ( ...args ) => executeTulindIndicator ( ...args , { options : { length : 6 } } ) ,
153
152
atr : ( ...args ) => executeTulindIndicator ( ...args , { sources : [ 'high' , 'low' , 'close' ] , options : { length : 14 } } ) ,
154
153
154
+ hma : ( source , indicator ) => {
155
+ let candleSource = ( indicator . options && indicator . options . source ) || 'close'
156
+
157
+ return executeTulindIndicator ( source , indicator , {
158
+ sources : [ candleSource ] ,
159
+ options : { length : 9 }
160
+ } ) } ,
161
+
155
162
cci : ( ...args ) =>
156
163
executeTulindIndicator ( ...args , {
157
164
sources : [ 'high' , 'low' , 'close' ] ,
0 commit comments