PINE LIBRARY
Atualizado WeightedSumIndex

Library "WeightedSumIndex"
WeightedSumIndex: Helper class to build indices.
Index value is a normalized weighted sum of all its input signals.
The value is from 0 to 100
fun(x)
TODO: add function description here
Parameters:
x (float): TODO: add parameter x description here
Returns: TODO: add what function returns
init()
Initialize an Index
Returns: A new instance of Index object with no signals
method add(idx, signal)
Adds the specified signal to the index
Namespace types: Index
Parameters:
idx (Index): The Index object
signal (Signal): Signal object
method calc(idx)
Caclulates the Index value
Namespace types: Index
Parameters:
idx (Index): The Index object
Returns: Normalized weighted sum of all signals with on=true
method update(idx)
Calculates the Index value by calling idx.calc() and stores its value in the Index object.
Namespace types: Index
Parameters:
idx (Index): The Index object
Signal
Parameters of input signal
Fields:
on (series bool): Switch the signal on/off
weight (series float)
value (series float): Value of the signal: should be between min and max
min (series float)
max (series float)
Index
The Index type with its properties and stored values
Fields:
signals (Signal[])
value (series float): Value of the index, must be calculated using calc() method
WeightedSumIndex: Helper class to build indices.
Index value is a normalized weighted sum of all its input signals.
The value is from 0 to 100
fun(x)
TODO: add function description here
Parameters:
x (float): TODO: add parameter x description here
Returns: TODO: add what function returns
init()
Initialize an Index
Returns: A new instance of Index object with no signals
method add(idx, signal)
Adds the specified signal to the index
Namespace types: Index
Parameters:
idx (Index): The Index object
signal (Signal): Signal object
method calc(idx)
Caclulates the Index value
Namespace types: Index
Parameters:
idx (Index): The Index object
Returns: Normalized weighted sum of all signals with on=true
method update(idx)
Calculates the Index value by calling idx.calc() and stores its value in the Index object.
Namespace types: Index
Parameters:
idx (Index): The Index object
Signal
Parameters of input signal
Fields:
on (series bool): Switch the signal on/off
weight (series float)
value (series float): Value of the signal: should be between min and max
min (series float)
max (series float)
Index
The Index type with its properties and stored values
Fields:
signals (Signal[])
value (series float): Value of the index, must be calculated using calc() method
Notas de Lançamento
v2 cleanup (nothing's changed)Biblioteca do Pine
No verdadeiro espirito do TradingView, o autor desse código Pine o publicou como uma biblioteca de código aberto, para que outros programadores Pine da nossa comunidade possam reusa-los. Parabéns ao autor! Você pode usar essa biblioteca privadamente ou em outras publicações de código aberto, mas a reutilização desse código em publicações é regida pelas Regras da Casa.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.
Biblioteca do Pine
No verdadeiro espirito do TradingView, o autor desse código Pine o publicou como uma biblioteca de código aberto, para que outros programadores Pine da nossa comunidade possam reusa-los. Parabéns ao autor! Você pode usar essa biblioteca privadamente ou em outras publicações de código aberto, mas a reutilização desse código em publicações é regida pelas Regras da Casa.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.