title: How to use an input in a security function (Multi TF indicator) on pinescript?
body: <p>I've tried to modify an indicator already available on <code>Tradingview</code>.</p>
  
  <p>The idea was to transform a <code>WaveTrends</code> in a "line" indicators which change color when an oversold or overbought condition is met. Those indicators are wavetrends from another timeframe.</p>
  
  <p>I have two problems with that, I want to use an input function to be able to change the timeframe without have to do it by changing the code.</p>
  
  <p>Second issue, You can see 4 line on the image </p>
  
  <ol>
  <li>mid TF short condition</li>
  <li>longTF short condition </li>
  <li>mid TF long condition </li>
  <li>longTF long condition. </li>
  </ol>
  
  <p>I bypassed my difficulties by creating 2 lines for long and 2 lines for short but I would like to combined them in only 2 lines with 3 different color : Green for oversold condition, red for overbought condition and finally gray in between.</p>
  
  <pre><code>study("WTcheckMTF", shorttitle="WTCMTF")
  
  n1 = input(10, "Channel Length")
  n2 = input(21, "Average Length")
  obLevel1 = input(60, "Over Bought Level 1")
  obLevel2 = input(53, "Over Bought Level 2")
  osLevel1 = input(-60, "Over Sold Level 1")
  osLevel2 = input(-53, "Over Sold Level 2")
  
  ap = hlc3 
  esa = ema(ap, n1)
  d = ema(abs(ap - esa), n1)
  ci = (ap - esa) / (0.015 * d)
  tci = ema(ci, n2)
  
  wt1 = tci
  wt2 = sma(wt1,4)
  
  //Mid and longer TF defining
  
  long = input("D", "Interval used for long TF", type = resolution)
  mid = input("360", "Interval used for mid TF", type = resolution)
  
  **MidWT = security(tickerid, "360",wt2)
  LongWT = security(tickerid, "720", wt2)**
  
  //treshold MT LT
  
  LWTLT = input(-53, "OS Threshold L")
  LWTMT = input(-53, "OS Threshold M")
  SWTLT = input(53, "OB Threshold L")
  SWTMT = input(53, "OB Threshold M")
  
  L1=1
  M1=2
  L2=3
  M2=4
  
  // Color for MT LT indicators
  
  **lcolor1 = LongWT &lt;= LWTLT ? lime : gray
  mcolor1 = MidWT &lt;= LWTMT ? lime : gray
  lcolor2 = LongWT &gt;= SWTLT ? red : gray
  mcolor2 = MidWT &gt;= SWTMT ? red : gray**
  
  // plot
  
  plot(L1, style=line,color=lcolor1,linewidth=25)
  plot(M1, style=line,color=mcolor1,linewidth=25)
  plot(L2, style=line,color=lcolor2,linewidth=25)
  plot(M2, style=line,color=mcolor2,linewidth=25)
  </code></pre>