Fix: Remove duplicate code in moving_average.js
The file had duplicate calculate() and getMetadata() methods causing syntax errors. Removed duplicate code from lines 214-251. Now the file has a single proper implementation.
This commit is contained in:
@ -211,43 +211,6 @@ let maValues;
|
||||
displayMode: 'overlay'
|
||||
};
|
||||
}
|
||||
|
||||
return maValues;
|
||||
}
|
||||
|
||||
getMetadata() {
|
||||
return {
|
||||
name: 'MA',
|
||||
description: 'Moving Average (SMA/EMA/RMA/WMA/VWMA)',
|
||||
inputs: [
|
||||
{
|
||||
name: 'period',
|
||||
label: 'Period',
|
||||
type: 'number',
|
||||
default: 44,
|
||||
min: 1,
|
||||
max: 500
|
||||
},
|
||||
{
|
||||
name: 'maType',
|
||||
label: 'MA Type',
|
||||
type: 'select',
|
||||
options: ['SMA', 'EMA', 'RMA', 'WMA', 'VWMA'],
|
||||
default: 'SMA'
|
||||
}
|
||||
],
|
||||
plots: [
|
||||
{
|
||||
id: 'value',
|
||||
color: '#2962ff',
|
||||
title: 'MA',
|
||||
style: 'solid',
|
||||
width: 1
|
||||
}
|
||||
],
|
||||
displayMode: 'overlay'
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// Export signal function for external use
|
||||
|
||||
Reference in New Issue
Block a user