‘Within’, Closed Candles and Price
Last updated February 7, 2025
Understanding: ‘Within’, Closed Candles and Price
For the above condition to trigger, the price increase by 5% 'WITHIN 15 minutes' would have to happen within one 15 minute candle. When we evaluate price increase, we need some price reference back in time, we use the closing price of the previous candle.
Using 'Within':
The condition below evaluates if there has been a price increase of 20% within 1 day.
- As reference it takes price close from the most recent closed candle (ie. yesterday)
- As the second reference it uses live price, so the condition could be met at any time today.
- It "resets" at the end of the current live candle (today)
Exception
The price indicator is almost always equal to live price. The only exception is when using a technical indicator crossing above/below price. In this case, we use the closing price instead because there’s no historical record in TradingView to verify if the crossover happened. Without this data, it would be difficult to confirm whether the event was accurate or not.
If you want to compare yesterday's price close with today's price close, you should use price close instead. In that case your condition would be if any coin has price close increase by 20% within 1 day (see image below).
Example 1
- Rule starts at 10.03pm, price for 1 ETH is 1,000 USD
- The last Close Price of the last closed 15 minutes candle (9.45pm) is 995 USD
- The condition is not met. The condition looks for a 5% increase over the 995 USD of the previous closed 15 minute candle
- Let's assume at 10.13pm the price of 1 ETH reaches 1,045 USD (straight from 995 USD).
- The condition of a 5% increase is met and the rule immediately triggers
Example 2
- Rule starts at 10.03pm, price for 1 ETH is 1,000 USD
- The last Close Price of the last closed 15 minutes candle (9.45pm) is 995 USD
- The condition is not met. The condition looks for a 5% increase over the 995 USD of the previous closed 15 minute candle
- Let's assume it is 10.37pm, the price of 1 ETH is 1,020, the 10.15pm Close Price of the 15 minute Candle was 1,010 USD. The condition now looks for a 5% price increase against the 1,010 USD.
- The rule would trigger if the price were to reach 1,060.5 USD which is a 5% increase.