I have created a plots based on higher timeframe to be viewed on lower timeframe. however, no plots are done when i shift to lower timeframe, what could be error in the code
study(title = "Trading system", shorttitle="TS", overlay =true)
//______________User inputs_________________
_1 = input(title = "═════ Bias Settings ═════", type = input.bool, defval = true)
i_resolution = input(title = "Select Bias Resolution", type = input.resolution, defval ="75")
//____________ variables ____________________
var float highValue = na
var float lowValue = na
var float bias = na
string barType = na
//_____________Calculations
//Assign high low for bias calculations
tfhigh = security(syminfo.tickerid,expression = high, resolution = i_resolution, gaps = barmerge.gaps_off, lookahead = barmerge.lookahead_on )
tflow = security(syminfo.tickerid,expression = low, resolution = i_resolution, gaps = barmerge.gaps_off, lookahead = barmerge.lookahead_on )
highValue := tfhigh < highValue[1] and tflow > lowValue[1] ? highValue[1] : tfhigh
lowValue := tfhigh < highValue[1] and tflow > lowValue[1] ? lowValue[1] : tflow
// Define Bar Types
barType := highValue > highValue[1] and lowValue > lowValue[1] ? "Up" : highValue < highValue[1] and lowValue < lowValue[1] ? "Down" : highValue > highValue[1] and lowValue < lowValue[1] ? "Out" : "In"
// Generate bias
bias := barType == "Up" ? highValue : barType == "Down" ? lowValue : barType == "Out" and barType[1] == "Up" ? highValue : barType == "Out" and barType[1] == "Down" ? lowValue : bias[1]
// Bias shift to bullish or bearish
bullishcondition = bias > bias[1] and bias[1] < bias[2]
bearishcondition = bias < bias[1] and bias[1] > bias[2]
// Values to plot
upBias = valuewhen(bullishcondition, bias[1],0)
dnBias = valuewhen(bearishcondition, bias[1],0)
plot(upBias, color = color.green)
plot(dnBias, color = color.red)
question from:https://stackoverflow.com/questions/65839230/pinescript-not-plotting-higher-resolution-calculations-on-lower-timeframe-charts