2015年9月11日 星期五

SQL-均線糾結+成交量大於5日均量3倍

select a.xDate , a.StockNo , b.Close_5MA ,c.Close_20MA , d.Close_55MA ,e.Volume_5MA, a.xVolume
from StockDailyHis2 as a
join Close_5MA as b on a.StockNo = b.StockNo and a.Date = b.Date
join Close_20MA as c on b.StockNo = c.StockNo and b.Date = c.Date
and ((cast(b.Close_5MA as float) / cast(c.Close_20MA as float) >=0.9)
or (cast(b.Close_5MA as float) / cast(c.Close_20MA as float) <=1.1))
join Close_55MA as d on b.StockNo = d.StockNo and b.Date = d.Date
and ((cast(b.Close_5MA as float) / cast(d.Close_55MA as float) >=0.9)
or (cast(b.Close_5MA as float) / cast(d.Close_55MA as float) <=1.1))

join Volume_5MA as e on a.StockNo = e.StockNo and a.Date = e.Date
and (cast(e.Volume_5MA as float) * 3 < cast(a.xVolume as float))

where a.xDate >= '20150101'
and cast(a.xVolume as float) > 1000
order by a.xDate , StockNo


紀錄: 9/11 跑出 2443,4526
過陣子再來看結果 XD

沒有留言:

張貼留言