hts with only two SMAs

This commit is contained in:
2025-07-21 21:20:39 +02:00
parent d2c45cac12
commit 38cdffc2b9
7 changed files with 93 additions and 10 deletions

View File

@ -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) {