TIMEFRAME function

You are here:
< All Topics

You can plot multiple timeframe in the same indicator pane with the TIMEFRAME function in VAI. This will allow traders to always be informed in one glance, without the need to change the price chart settings every time.

Syntax:
TIMEFRAME(timeframe) //where you place this code is important. Place this on top of each indicator
set closeTIMEFRAME = close //can be either of OPEN, HIGH, LOW, CLOSE

Timeframes periods:
TIMEFRAME(daily)
TIMEFRAME(weekly)
TIMEFRAME(monthly)
//intraday timeframes soon!

Example Script:
// RSI daily and weekly plotted in the same pane.
TIMEFRAME(daily)
set closedaily = close
set RSId = rsi(closedaily,14)
TIMEFRAME(weekly)
set closeweekly = close
set RSIw = rsi(closeweekly,14)

//plot
plot(RSId,line,red,rsi)
plot(RSIw,line,cyan,rsi)
plot(70,line,red,RSI)
plot(30,line,green,RSI)

Previous STOP & TSTOP Function
Next SIGNALS Function
Table of Contents