-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmain.lua
74 lines (65 loc) · 1.6 KB
/
main.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package.path = getScriptPath() .. '/?.lua;' .. package.path
local RankedWatchList = require('ranked_watch_list')
local settings = {
color = {
new = RGB(0, 255, 0),
old = RGB(255, 255, 0),
out = RGB(255, 0, 0)
},
daysBack = 0,
top = 8,
period = 5, -- trading week
}
local getWatchList = function ()
return {
TQBR = {
"RASP",
"HYDR",
"GMKN",
"LKOH",
"MVID",
"CHMF",
"MFON",
"NVTK",
"ALRS",
"NLMK",
"RTKM",
"SNGSP",
"ROSN",
"IRAO",
"FEES",
"PHOR",
"RSTI",
"MAGN",
"SIBN",
"TRNFP",
"SBERP",
"VTBR",
"SNGS",
"GAZP",
"MGNT",
"MTSS",
"TATN",
"MSNG",
"SBER",
"MOEX",
"AFLT",
"MTLR"
}
}
end
-----
function main ()
local tId = AllocTable()
AddColumn(tId, 0, "Ticker", true, QTABLE_STRING_TYPE, 15) -- ticker
AddColumn(tId, 1, "Close", true, QTABLE_DOUBLE_TYPE, 20) -- close
AddColumn(tId, 2, "StopLoss", true, QTABLE_DOUBLE_TYPE, 20) -- recommended stop loss price
AddColumn(tId, 3, "Prev. close", true, QTABLE_DOUBLE_TYPE, 20) -- close on prev. week
AddColumn(tId, 4, "% diff", true, QTABLE_DOUBLE_TYPE, 15) -- % difference
AddColumn(tId, 5, "Rank", true, QTABLE_INT_TYPE, 15) -- rank
AddColumn(tId, 6, "Prev. Rank", true, QTABLE_INT_TYPE, 15) -- previous rank
AddColumn(tId, 7, "Avg. daily vol", true, QTABLE_DOUBLE_TYPE, 20) -- avg. daily vol for 2 weeks
CreateWindow(tId)
local rankedWatchList = RankedWatchList:new(getWatchList(), settings)
rankedWatchList:renderToTable(tId)
end