hts with only two SMAs
This commit is contained in:
@ -1,14 +1,29 @@
|
||||
/**
|
||||
* Indicator Definition Object for SMA.
|
||||
* Indicator Definition Object for Fast SMA.
|
||||
*/
|
||||
const SMA_INDICATOR = {
|
||||
name: 'SMA',
|
||||
label: 'Simple Moving Average',
|
||||
const FAST_SMA_INDICATOR = {
|
||||
name: 'FAST_SMA',
|
||||
label: 'Fast SMA',
|
||||
usesBaseData: false, // This simple indicator uses the chart's currently displayed data
|
||||
params: [
|
||||
{ name: 'period', type: 'number', defaultValue: 20, min: 2 },
|
||||
{ name: 'period', type: 'number', defaultValue: 33, min: 2 },
|
||||
],
|
||||
calculateFull: calculateFullSMA,
|
||||
color: '#00bcd4',
|
||||
};
|
||||
|
||||
/**
|
||||
* Indicator Definition Object for Slow SMA.
|
||||
*/
|
||||
const SLOW_SMA_INDICATOR = {
|
||||
name: 'SLOW_SMA',
|
||||
label: 'Slow SMA',
|
||||
usesBaseData: false, // This simple indicator uses the chart's currently displayed data
|
||||
params: [
|
||||
{ name: 'period', type: 'number', defaultValue: 133, min: 2 },
|
||||
],
|
||||
calculateFull: calculateFullSMA,
|
||||
color: '#ff5252',
|
||||
};
|
||||
|
||||
function calculateFullSMA(data, params) {
|
||||
|
||||
Reference in New Issue
Block a user