Closed OdinLin closed 1 month ago
stock_2 is dependent and stock 1 is independent. https://www.statsmodels.org/dev/generated/statsmodels.regression.rolling.RollingOLS.html
But if stock_2 is dependent, The spread should be stock_data_df[stock_2] - stock_data_df[stock_1] stock_data_df["hedge_ratio"] ? But origin is stock_data_df[stock_1] - stock_data_df[stock_2] stock_data_df["hedge_ratio"]
But if stock_2 is dependent, The spread should be stock_data_df[stock_2] - stock_data_df[stock_1] stock_data_df["hedge_ratio"] ? But origin is stock_data_df[stock_1] - stock_data_df[stock_2] stock_data_df["hedge_ratio"]
yes I think youre right, changed it. Thx
Hello at https://github.com/AidanAlr/Alpaca-Pairs-Trading-Terminal/blob/4cff49ed59a6f94c02850a3679bae1ae8897fa61/analysis/statistical_methods.py#L59 Should it be stock_data_df[stock_2] - stock_data_df[stock_1] * stock_data_df["hedge_ratio"] ? because according to
stock_2 is independent variable and stock_1 is dependent variable, Or I misunderstood this?