Reputation: 65
I am using the following code for calculating daily range -
dailyHigh1 = request.security(syminfo.tickerid,"D" , high[1],lookahead=barmerge.lookahead_on)
dailyLow1 = request.security(syminfo.tickerid,"D" , low [1],lookahead=barmerge.lookahead_on)
dayrange1 = dailyHigh1 - dailyLow1
This approach is limiting me from calling more periods of a security as tradingview limit is 40. If there is a way around it, possible to code it in one line, by calling only one security instead of two, please let me know.
Thanks for your time. Regards.
Upvotes: 0
Views: 285
Reputation: 1368
you can merge multiple items that you want for one timeframe
[dailyHigh1 ,dailyLow1]=request.security(syminfo.tickerid,"D" , [high[1],low[1]],lookahead=barmerge.lookahead_on)
Upvotes: 1