forked from morefinances/qlua
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetQuoteLevel4.lua
More file actions
51 lines (32 loc) · 1002 Bytes
/
getQuoteLevel4.lua
File metadata and controls
51 lines (32 loc) · 1002 Bytes
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
function main()
SumOffer = 0
SumBid = 0
quotelvl = getQuoteLevel2("TQBR", "SBER")
if quotelvl then
if quotelvl.offer then
message("Ïðåäëîæåíèå:")
for i = quotelvl.offer_count, 1, -1 do
offer = tonumber(quotelvl.offer[i].price)
quant = tonumber(quotelvl.offer[i].quantity)
sum = 10 * offer * quant
SumOffer = SumOffer + sum
message(i..") "..offer.." * "..quant.." * 10 = "..sum.." SumOffer:"..SumOffer)
end
else
message("Íåò äàííûõ ïî ïðåäëîæåíèÿì")
end
message(string.rep("-",10)) -- ðàçäåëèòåëü
if quotelvl.bid then
message("Ñïðîñ:")
for i = quotelvl.bid_count, 1, -1 do
bid = tonumber(quotelvl.bid[i].price)
quant = tonumber(quotelvl.bid[i].quantity)
bsum = 10 * bid * quant
SumBid = SumBid + bsum
message(i..") "..bid.." * "..quant.." * 10 = "..bsum.." SumBid:"..SumBid)
end
else
message("Íåò äàííûõ ïî ñïðîñó")
end
end
end