Icon

01_Stocks1 (Working one) 4.3

Annotations and comments
  • Stock Analysis: Automatic value prediction and alerting The input to this workflow is a list of stock symbols from Yahoo Finance. After some preprocessing to determine the date range, this information is sent to the pandas webreader library (through the Python Source node) to collect (near) realtime stock information. The information is sent to the modeling workflow (through the Call Workflow node) where feature creation, model estimation, and prediction takes place for each stock symbol. This workflow collects the predictions and the reliability of the model, and visually displays the results - the expected percentage change in value for each stock symbol. Note: To use this workflow you need to have Python and the following libraries installed on your machine: -pandas as pd -pandas-datareader -datetime
  • This section creates the workflow variables that are sent to the Python Source node
  • The workflow variables are sent to the Python Source node, which gathers historical data for each symbol. It can occur that data for a specific symbol is (temporarily) unavailable, in which case a value of -99 is returned. These cases are sent to the bottom port of the If Switch node and are filtered out after the Loop End node.
  • The predicted increased in stock value is sorted and exported to a plot and .csv files. When deployed on KNIME server, the Send Email node can be used to alert traders of potential interesting stock developments on a daily basis. Authentication is supported via workflow or node level credentials; connection security via STARTTLS and SSL are both supported.
  • Write daily predictions to a .csv
  • Add predictions to history file
  • Extract today's date
  • Deduct one day
  • Filter first row of the dataset
  • Create rule based on the 'execute field': 0 => bottom (stock is not available) 1 => top (stock is not available)
  • Convert to flow variable
  • Decompose date to day, month and year
  • Export plot to a file
  • Merge date variables with stock symbol
  • Choosing the prediction
  • New columns
  • Diff
  • Diff - 5%
  • Compute model evaluation metrics
  • Predict Stock Value
  • Select features from variable selection loop
  • Estimate model
  • 1 day
  • Filter unnecessary columns
  • Rename row number variable to Trend
  • Deduct 18 from trend (because we take 19 lag variables)
  • Use row number
  • Extract number from row number
  • Node 210
  • Extract month from date
  • ATR
  • Candle
  • True_Candle
  • BB Width
  • Close*Price
  • VWAP
  • OBV
  • Pivot Points
  • Z_Score
  • Log Returns
  • HV
  • Skewness
  • Volatility Regime
  • Adj Close -15
  • RSI -15
  • Volume -8
  • BB Midle -15
  • BB Upper -15
  • BB Lower -15
  • High -15
  • Low -15
  • Candle -8
  • Low_Candle -8
  • High_Candle -8
  • Close_Candle -8
  • BB_Width -15
  • VWAP 8
  • OBV MA
  • Create month dummy variables
  • Remove tomorrow
  • Convert Date column to Date field
  • Join RowID
  • X + 0.01
  • Deviation
  • Condition Rule
  • Diff Rule
  • Remove columns
  • End Feature selection loop
  • Start feature selection loop (forward)
  • Estimate model iteration
  • Determine fit for model iteration
  • Predict model iteration on validation data
  • Split 60 score rows
  • 53
  • TP_HIGH
  • SL_HIGH
  • P/L
  • Win/Lose
  • TP_LOW
  • SL_LOW
  • Choosing entrance price
  • Close_price
  • Buy/Sell
  • SL
  • TP
  • W/L count
  • Leverage
  • Lose Cause
  • Pool
  • Score day
  • generic
  • Remove unnecessary columns
  • Resort columns
  • Create data variable
  • Merge datasets
  • + RSI
  • Filter unavailable symbols
  • Attach .csv file and plot of stock predictions to an e-mail
  • Sort symbols by expected % increase
  • Insert a list of stock symbols
  • Convert to workflow variables

Nodes

Extensions

Links