2015年8月29日 星期六

SQL-爆量長紅

select W.StockNo , W.Date , W.xOpen '開盤價', W.xClose '收盤價', W.xHigh '最高價', W.xLow '最低價',
W.xVolume '成交量', X.Volume_20MA '20MA成交量', W.Rate '漲跌幅'
from StockDailyHis as W
join Volume_20MA as X on W.Date = X.Date and W.StockNo = X.StockNo
where cast(W.Rate as float) > 4 --漲4%以上
and cast(W.xVolume as float) > 1000 --成交量千張以上
and cast(W.xVolume as float) > cast(X.Volume_20MA as float) *3  --今日成交量超過3倍20日均量
and W.xClose > W.xOpen --紅K
order by W.Date , W.StockNo

沒有留言:

張貼留言