Tr0sT

[Question] How to change series value

Does anybody know how to change last value of series? For example, I need to calculate EMA for series like this: (... , close, close, close, close + 150). How to achieve this?

Attached script calculates EMA for (..., close + 150, close + 150, close + 150, close + 150), ignoring my equations.
Note di rilascio: I 've got a great answer there https://getsatisfaction.com/tradingview/...
As I understood there is no way to build such serial.
Rimuovi dagli script preferiti Aggiungi agli script preferiti

Commenti

You can add the 150 in the input of the function: _plot = f_ema (close + 150, b , a)
Rispondi
Tr0sT sdao85
@sdao85, then 150 will be added to each element of the series (close + 150, close + 150, close + 150, etc). It is impossible to change one element of a serias with current version of pine script.
Rispondi
sdao85 Tr0sT
@Tr0sT, try to name your series then adjust the current value:
= _plot
seriesT =: seriesT + 150
Rispondi
sdao85 sdao85
for some reasons it didn't do = _plot
Rispondi
Tr0sT sdao85
@sdao85, it does not work. see the official answer from trading view https://getsatisfaction.com/tradingview/topics/pine-script-function-calculation-error
Rispondi
sdao85 Tr0sT
@Tr0sT, Ok, I understand your intention now. If you just want to printout decorative value then it doesn't matter. Just create a new variable and add your _plot value to the value of your choice:
newValue = _plot + 150
plot(newValue)

hope it helps.
Rispondi
Tr0sT sdao85
@sdao85, i want to create a series x equals to (close+150, close, close,...). That is not possible.
Rispondi
Tr0sT Tr0sT
@Tr0sT, close +150,close(1), close(2)... Square brackets removed dont know why
Rispondi
Home Screener azioni Screener forex Screener cripto Calendario economico Come funziona Caratteristiche Grafico Costi Invita un amico Regolamento Centro di supporto Soluzioni per broker & siti web Widget Librerie grafiche Libreria grafica leggera Blog & Novità Twitter
Profilo Impostazioni profilo Account e fatturazione Invita un amico I miei ticket di supporto Centro di supporto Idee pubblicate Follower Seguiti Messaggi Privati Chat Esci