What should we use to get a current price of a stock,
Answer: def currentPrice = close;
For any selected time frame, always and forever, without exception. Current price ALWAYS equals close. Period. Then End.
Sorry to be so emphatic but I constantly have to explain this to people and I truly do not understand why this is so difficult to understand or accept. If you don't believe me, then challenge me. Do your very best to try to prove me wrong. Then I will demonstrate that I am correct. I really am tired of answering the question and trying to get folks to understand this.
if the candle opens at $1.1 and then moves up, we retrieve the price if it reaches 1.1 * 1.05 before the candle closes higher?
Answer:
plot scan = close >= open * 1.05;
In plain English that code statement says this: Return true as soon as the current bar's close is greater than or equal to the current bar's open times 1.05. Done.
Now, before closing I will caution everyone against using 1 min time frames for notifications and scans. For some reason many are obsessed with 1 min time frame. And I bet if there was a 1 nanosecond time frame they would be obsessed with that instead. Useless. Utterly, completely useless.
The main argument I get when I question the use of 1 min time frame? I need real time information. BS! You can run a scan on a daily time frame and get the same response time as the 1 min time frame if your are comparing only daily data points. The 1 min time frame does not make a scan run faster.
In fact for the vast majority of code the 1 min time frame makes the scan run SLOWER!!! The whole reason I explained all of that was to let you know that for most cases when you select the 1 min time frame the scan results will be delayed approximately 3-5 min. So you loose. Move to a 5 min time frame. You want to know how many times I have personally run a scan using the 1 min time frame? ZERO! Why? Because it slows things down.
I hope I have answered your question but I also hope that I have made progress in getting the audience to understand the close is always the most current price and 1 min time frames are utterly useless for Scan, Study Alerts, Conditional Orders and Custom Quotes in Watchlists.