From 9503daceb1fb85ab72b647d5658497bb8be52cdd Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Thu, 4 Feb 2016 03:38:48 +0100 Subject: [PATCH] fix for or filter --- history.lua | 4 ++-- scan_util.lua | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/history.lua b/history.lua index 5de7a46..e3ea818 100644 --- a/history.lua +++ b/history.lua @@ -143,7 +143,7 @@ function private.median(list) if getn(list) == 0 then return end - + local middle = (getn(list) + 1) / 2 return (list[floor(middle)] + list[ceil(middle)]) / 2 end @@ -160,7 +160,7 @@ function private.push_data() local daily_market_value = private.daily_market_value(item_record.histogram) - private.balanced_list_insert(item_record.balanced_list, daily_market_value, 7) + private.balanced_list_insert(item_record.balanced_list, Aux.round(daily_market_value), 9) item_record.day_count = item_record.day_count + 1 item_record.histogram = {} diff --git a/scan_util.lua b/scan_util.lua index 704793d..830f653 100644 --- a/scan_util.lua +++ b/scan_util.lua @@ -293,9 +293,11 @@ function m.validator(filter) for i=getn(filter.tooltip),1,-1 do local op = strupper(filter.tooltip[i]) if op == 'AND' then - tinsert(stack, tremove(stack) and tremove(stack)) + local a, b = tremove(stack), tremove(stack) + tinsert(stack, a and b) elseif op == 'OR' then - tinsert(stack, tremove(stack) or tremove(stack)) + local a, b = tremove(stack), tremove(stack) + tinsert(stack, a or b) elseif op == 'NOT' then tinsert(stack, not tremove(stack)) elseif op ~= 'TT' then