|
|
@@ -20,13 +20,14 @@ if __name__ == '__main__':
|
|
|
model.put_timestamp_stored(timestamp_latest)
|
|
|
timestamp_previous = model.get_timestamp_previous(db)
|
|
|
for stock in stocks.stocks:
|
|
|
- data_previous = model.get_data(stock.stock_id, timestamp_previous, db)
|
|
|
- data_latest = model.get_data(stock.stock_id, timestamp_latest, db)
|
|
|
+ stock_id = stock[1]
|
|
|
+ data_previous = model.get_data(stock_id, timestamp_previous, db)
|
|
|
+ data_latest = model.get_data(stock_id, timestamp_latest, db)
|
|
|
threshold = stock[3]
|
|
|
is_drop = model.process_data(data_previous, data_latest, threshold)
|
|
|
- stock_name = stock[0]
|
|
|
current_price = data_latest.current_price
|
|
|
quantity = data_latest.available_shares = data_previous.available_shares
|
|
|
+ stock_name = stock[0]
|
|
|
message = view.create_message(
|
|
|
stock_name, timestamp_latest, current_price, quantity)
|
|
|
print(message)
|