module Main where import HQuant.History import HQuant.LoadHistory import HQuant.Technical import Data.List import HQuant.Chart nperiods = 10 spy = readHistory "SPY" main = do hs <- spy let hsplot = map (\h -> PlotPoint (hperiod h) (close h)) hs :: [PlotPoint] let smaspy = simpleMovingAverage nperiods hs :: [PlotPoint] print smaspy let start = head hsplot let end = head $ reverse hsplot let match = drop (nperiods-1) hsplot priceChartStudy ("SMA("++show nperiods++")") (map plotLocalTime match) (map plotLocalTime smaspy)