In specific, I will set a certain price to a stock and I want to know how long takes until the historical prices reach this price. Thanks you.
Well, there's no simple answer, but with some assumptions on price generating process you can try to come up with some estimates. If you assume ABM, then your expected time until a price reaches a certain level is infinite . But you can also derive probability density of how long you would have to wait .
Maybe some smarter forum member would add if there are similar formulas for GBM.