Skip to content

A cross-platform stock monitor with user-generated run-time evaluated indicators

Notifications You must be signed in to change notification settings

DanielToby/prescy-stocks

Repository files navigation

A cross-platform live stock monitor with user-generated run-time evaluated indicators

Demo

Multithreaded stock querying via curl

Stock data is pulled every ten seconds from the Yahoo Finance API. The work is distributed among a variable number of threads.

Indicators using Lua expression evaluation

Lua expressions are also evaluated every ten seconds. Data is pushed onto the Lua stack in nested tables. When stock data is refreshed, the Lua expression is evaluated. The result is shown to the right of each stock. So long as the syntax is correct and the necessary data is present, expressions can comprise any valid script.

Percent Changed

setResult( (data[__size - 1].close - data[0].open) / data[__size - 1].close * 100 )

Modified Moving Average

function mma(i)
 if i == 0 then 
   return (1 / __size) * data[i].close
 else
   nextIterationResult = mma(i-1)
   return nextIterationResult + (1 / __size) * (data[i].close - nextIterationResult)
 end
end

setResult(mma(__size - 1))

Graphs drawn with Qt

Graphs are redrawn on every QWidget::paintEvent. The line and candlestick data is sourced from the stock queries.

About

A cross-platform stock monitor with user-generated run-time evaluated indicators

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published