def get_stock_value(ticker): bl = create_business_logic() prediction = bl.do_predictions_for(ticker) last_close = get_last_price(ticker) live_price = get_live_price(ticker) return f'<br/><br/>{ticker} prediction: {prediction}<br/><br/>{ticker} last close: {last_close}' \ f'<br/><br/>{ticker} live price: {live_price}<br/><br/>'
def get_stock_value(ticker): createbl = create_business_logic() applybl = BusinessLogic(ticker) prediction = createbl.do_predictions_for(ticker) buyorsellreco = applybl.classificationbuysell(ticker) #return f'Tomorrow, we predict a value of: {prediction}$.\n We recommend to {buyorsellreco}\n' return buyorsellreco
def get_stock_value(ticker): bl = create_business_logic(ticker) prediction = bl.do_predictions_for(ticker) recommendation = prediction[1] ba_score_test = prediction[0] answer = "Tomorrow's prediction for " + str(ticker) + ": " \ + "we recommend you to " + recommendation + " it." \ +" Note that our latest accuracy score for this ticker is: " + ba_score_test return recommendation
def get_stock_val_with_accuracy(ticker): bl = create_business_logic() prediction_and_score = bl.do_predictions_for(ticker) last_close_price = get_last_close_price(ticker) result = { "ticker": f'{ticker}', "last_close_price": f'{last_close_price.get("close")}', "prediction": f'{prediction_and_score.get("prediction")}', "balanced_accuracy": f'{prediction_and_score.get("balanced_accuracy")}' } return f'{result}'
def get_stock_value(ticker): bl = create_business_logic() bl2 = create_business_logic2() prediction = bl.do_predictions_for(ticker) prediction2 = bl2.do_predictions_for(ticker) last_close = get_last_close(ticker) live_price = get_live_price(ticker) before_yesterday_close = get_last_last_close(ticker) return f'<br/><br/>{ticker} prediction for last close: {prediction}' \ f'<br/><br/>{ticker} last close: {last_close}' \ f'<br/><br/>{ticker} prediction for next close: {prediction2}' \ f'<br/><br/>{ticker} live price: {live_price}' \ f'<br/><br/>{ticker} previous close: {before_yesterday_close}<br/><br/>'
def get_stock_value(ticker): bl = create_business_logic() prediction = bl.do_predictions_for(ticker) return f'{prediction}\n'
def get_stock_value(ticker): bl = create_business_logic() prediction = bl.do_predictions_for(ticker) output = prediction # return prediction return render_template('results.html', output=output)
def get_stock_value(ticker): bl = create_business_logic() prediction_and_score = bl.do_predictions_for(ticker) return prediction_and_score.get("prediction")