title: Get the Lowest price from last condition till now pine script
body: <p>I want to find the lowest price from yellow candle till white candle ( 75 candles apart )</p>
  <p>yellow bar = last condition</p>
  <p>white bar = the condition happened now</p>
  <p>I used some codes i don't know which are right or wrong . please help</p>
  <pre><code>// The problem with this code (barssince)is when the white bar happens it zeros the plot 
  because the Long_Condition happens in that candle so it zeros the amount i want to use
  
  
  since = barssince(Long_Condition)
  lowest_price = lowest(since)
  
  </code></pre>
  <p>now with the plots there are some problems :</p>
  <p>problem 1</p>
  <p><code>plot(since , title = &quot;bars back&quot; , color = color.blue)</code></p>
  <p>in the picture attached you can see the blue plot zeros the amount that was counting which at the
  last candle it gave 74 and then when i want to get 75 it gives the zero .(from yellow bar to white bar it is 75 candles)
  and which basically the below code will be wrong and it doesn't run the script .</p>
  <p><code>lowest_price = lowest(since)</code></p>
  <p>Now , if i use this code which I don't know if it is right or wrong but here it is :</p>
  <pre><code>index_white = valuewhen(Long_Condition , bar_index , 0)
  
  index_yellow = valuewhen(Long_Condition , bar_index , 1)
  
  int final_index = index_white - index_yellow 
  
  Lowest_price = lowest(final_index)
  </code></pre>
  <pre><code>plot_1 = plot(final_index , color = color.blue)
  plot_2 = plot(Lowest_price)
  </code></pre>
  <p>Now the <code>plot_1</code> works great but when i add <code>plot_2</code> to the script , it doesn't run it .</p>
  <p>Isn't <strong>final_index</strong> Integer that <code>Lowest(final_index)</code> doesn't work ?</p>
  <p>please help me . Thanks</p>
  <p>Picture 2 is coded with enabled <code>plot_1</code>.</p>
  <p><a href="https://i.stack.imgur.com/UdG4H.png" rel="nofollow noreferrer">Click to see the Picture #1</a></p>
  <p><a href="https://i.stack.imgur.com/E62c4.png" rel="nofollow noreferrer">Click to see the Picture #2</a></p>