title: Keep count of a "Buy" signal within a day then put count to 0 if a "Sell" signal happens and paint a cnadle or vertical line
body: <p>basically I made a script that paints a candle if certain conditions are met which is my &quot;Buy&quot; signal.</p>
  <p>I want to keep track of those candles within a day and increment a count, therefore the trade is valid as long as the count is &gt;= 1 within that day, but also keep track of the lows of those &quot;Buy&quot; candles and average them as long as count &gt;=1, again within a day. The trade would be valid as long as the price doesn't fall below the average of those lows.</p>
  <p>The sell signal would be defined as</p>
  <p>if count &gt;= 1 &amp;&amp; (conditionA + conditionB) then and then paint a candle or display a vertical line and then revert count to 0 . This would mark the exit of the trade.</p>
  <p>I want to know if such a thing is possible within thinkscript.</p>
  <p>Thanks in advance to whomever can help.</p>