Finalize the AI model
This commit is contained in:
@@ -21,8 +21,10 @@ def Predict():
|
||||
# Pull 1 month of current data to make prediction against | for volatility 20
|
||||
df = yf.download(Symbol, period="2mo", auto_adjust=True)
|
||||
if not df.empty:
|
||||
# Remove the ticker column
|
||||
# Remove the horizontal ticker column
|
||||
df.columns = df.columns.get_level_values(0)
|
||||
# Add in the Vertical ticker column
|
||||
df['Ticker'] = Symbol
|
||||
# Make the feature set
|
||||
df = features.MakeFeatures(df)
|
||||
|
||||
@@ -61,10 +63,10 @@ def Predict():
|
||||
|
||||
# Set the movement indicator
|
||||
movement_indicator = 0
|
||||
averagePrediction = np.mean(flat_predictions)
|
||||
if (averagePrediction > 0.005): # as in 3% swing up
|
||||
averagePrediction = np.mean(flat_predictions) + predictionTrend
|
||||
if (averagePrediction > 0.3): # as in 3% swing up
|
||||
movement_indicator = 1
|
||||
elif (averagePrediction < -0.005): # as in 3% swing down
|
||||
elif (averagePrediction < -0.3): # as in 3% swing down
|
||||
movement_indicator = -1
|
||||
else:
|
||||
movement_indicator = 0
|
||||
|
||||
Reference in New Issue
Block a user