Parameters | Description | Value |
---|---|---|
LSTM layers | - | 2 |
LSTM Nodes | - | 33 |
Dense Nodes | - | 95 |
Dense Activation | - | selu |
Normalisation window | - | 1000 |
Batch size | Number of sequence in a batch | 150 |
Sequence length | Number of previous points to take into account | 22 |
News lag | Number of days prior to current day to take news into account | 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def normalise_df(df,asset,norm_window_size=100,use_preloaded_scalers=False): | |
""" | |
Normalise the dataframe. | |
This normalises by column (i.e. feature). Some people call this scaling | |
Args: | |
df(pd.df): The dataframe to normalise | |
asset (str): Stock name we're trying to predict (or first stock name) | |
norm_window_size (int): The window size for each feature to normalise. | |
use_preloaded_scalers (bool): False for training, True for inference |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ib_insync import * | |
import asyncio | |
import nest_asyncio | |
async def update_from_IB(stock): | |
""" | |
Asynchronous call example to update stocks from Interactive broker. | |
Args: | |
stock(str): Stock, I.e. AAPL |