str
Syntax
Parameters
Return Value
Example
//@version=1
// This is the setup function.
// Here you can define the input parameters for the indicator.
init = () => {
input.str(
'Custom Label',
'My Strategy',
undefined,
undefined,
'Name displayed on chart',
'General Settings'
);
// Dropdown input for moving average type
input.str(
'MA Type',
'SMA',
undefined,
['SMA', 'EMA', 'WMA'],
'Choose the moving average calculation method',
'Moving Averages',
'ma-row'
);
}
// This is the main function. It is called every time a new candle is received.
// Here you can calculate the indicator values and draw the indicator on the chart.
onTick = (length, _moment, _, ta, inputs) => {
};Result

Last updated