Paul Cas
Paul Cas

Reputation: 39

How to plot ema from different time period? Pinescript

I am unsure as to why this code does not work to reference and plot a 5min chart HMA 49. keep getting line 13: Syntax error at input '5'. I am stumped?

any help would be greatly appreciated!

Thanks in advance,

Paul

//Get Values

hma49 = hma(close,49)
hma9 = hma(close,9)
ema9 = ema(close,9)
5minhma49 = security(syminfo.ticker,5, hma(close,49))
t = tickerid(syminfo.prefix, syminfo.ticker)

Upvotes: 0

Views: 279

Answers (1)

Bjorn Mistiaen
Bjorn Mistiaen

Reputation: 6905

You cannot start a variable name with a digit.
See reference manual Identifiers

You could change 5minhma49 to min5hma49 for example, to make it compile properly.

Upvotes: 1

Related Questions