Is it possible to have different Aggregation Period on the same chart display?


Is it possible to add a different chart Aggregation Period as a lower study? I'm using the code below but it is not changing the aggregation. I trade on the 4h chart.

declare lower;
input agg = AggregationPeriod.hour;

def o = open(getUnderlyingSymbol());

def h = high(getUnderlyingSymbol());

def l = low(getUnderlyingSymbol());

def c = close(getUnderlyingSymbol());


Last edited:


Well-known member
It should look like this:

input symbol = "EUR/USD";
input period = AggregationPeriod.MONTH;
input price_type = {default "LAST", "BID", "ASK", "MARK"};
plot Data = open(symbol, period, price_type);


Well-known member
Thank you. This awesome. Is there a way instead of inputting symbol to get it automatically change when selecting from a watchlist?
If you don't specify the symbol it will use whichever stock your watching on the current chart. Alternatively you could use an input variable that lists as many stocks as you want (just like the first line of code above) and choose which one you want for that chart. There are many options.