Create a Candlestick Plot in Stata
A candlestick plot can be used to identify different aspects of a data, categorised over time or another variable. For example, this candlestick plot is comparing prices over four different dates,

The candlestick plot can be made using the code below:
clear
input str3 share str20 time price
abc "1/5/2011:10:34" 10.34
abc "1/5/2011:10:35" 10.25
abc "1/5/2011:10:36" 10.15
abc "1/5/2011:10:37" 10.73
abc "1/5/2011:10:39" 10.95
abc "1/5/2011:10:41" 10.53
abc "1/5/2011:10:45" 10.99
abc "1/5/2011:10:49" 11.05
abc "2/5/2011:10:34" 9.34
abc "2/5/2011:10:35" 9.25
abc "2/5/2011:10:36" 9.15
abc "2/5/2011:10:37" 9.73
abc "2/5/2011:10:39" 9.95
abc "2/5/2011:10:41" 9.53
abc "2/5/2011:10:45" 9.99
abc "2/5/2011:10:49" 9.05
abc "3/5/2011:10:34" 8.34
abc "3/5/2011:10:35" 8.25
abc "3/5/2011:10:36" 8.15
abc "3/5/2011:10:37" 8.73
abc "3/5/2011:10:39" 8.95
abc "3/5/2011:10:41" 8.53
abc "3/5/2011:10:45" 8.99
abc "3/5/2011:10:49" 12.05
abc "4/5/2011:10:34" 12.34
abc "4/5/2011:10:35" 12.25
abc "4/5/2011:10:36" 12.15
abc "4/5/2011:10:37" 12.73
abc "4/5/2011:10:39" 12.95
abc "4/5/2011:10:41" 12.53
abc "4/5/2011:10:45" 12.99
abc "4/5/2011:10:49" 17.05
end
gen double date=dofc(clock(time,"DMY hm"))
format date %td
collapse (p1) p1=price (p25) p25=price (p50) p50=price (p75) p75=price (p99) p99=price, by(date)
gen uav=p75- 1.5 * (p25-p75)
gen lav=p75+ 1.5 * (p25-p75)
gen col=2
replace col=(p50-p50[_n-1])>0 if _n!=1
twoway (rbar p75 p25 date if col==0, barwidth(.6) color(red)) ///
(rbar p75 p25 date if col==1, barwidth(.6) color(green)) ///
(rbar p75 p25 date if col==2, barwidth(.6) color(black)) ///
(rspike uav lav date if col==2, lwidth(thick) color( black)) ///
(rspike uav lav date if col==1 , lwidth(thick) color( green)) ///
(rspike uav lav date if col==0 , lwidth(thick) color(red)), legend(off)