jingedawang / StockPredictor

Predict the stock price with AI models.
http://stockprediction.org/
MIT License
20 stars 6 forks source link

What factor is useful for stock prediction? #8

Closed jingedawang closed 1 year ago

jingedawang commented 1 year ago

Currently, we use following factors to train the model. They are all generated from prices.

Part 1: The candlestick chart factors

KMID: ($close-$open)/$open KLEN: ($high-$low)/$open KMID2: ($close-$open)/($high-$low+1e-12) KUP: ($high-Greater($open, $close))/$open KUP2: ($high-Greater($open, $close))/($high-$low+1e-12) KLOW: (Less($open, $close)-$low)/$open KLOW2: (Less($open, $close)-$low)/($high-$low+1e-12) KSFT: (2$close-$high-$low)/$open KSFT2: (2$close-$high-$low)/($high-$low+1e-12)

Part 2: Rolling window factors. These factors are computed with window width d in [5, 10, 20, 30, 60].

ROC: Ref($close, %d)/$close MA: Mean($close, %d)/$close STD: Std($close, %d)/$close BETA: The rate of close price change in the past d days, divided by latest close price to remove unit. RSQR: The R-sqaure value of linear regression for the past d days, represent the trend linear. RESI: The redisdual for linear regression for the past d days, represent the trend linearity for past d days. MAX: The max price for past d days, divided by latest close price to remove unit. LOW: The low price for past d days, divided by latest close price to remove unit. QTLU: The 80% quantile of past d day's close price, divided by latest close price to remove unit. QTLD: The 20% quantile of past d day's close price, divided by latest close price to remove unit. RANK: Get the percentile of current close price in past d day's close price. RSV: Represent the price position between upper and lower resistent price for past d days. IMAX: The number of days between current date and previous highest price date. IMIN: The number of days between current date and previous lowest price date. IMXD: The time period between previous lowest-price date occur after highest price date. CORR: The correlation between absolute close price and log scaled trading volume. CORD: The correlation between price change ratio and volume change ratio. CNTP: The percentage of days in past d days that price go up. CNTN: The percentage of days in past d days that price go down. CNTD: The diff between past up day and past down day. SUMP: The total gain / the absolute total price changed. SUMN: The total lose / the absolute total price changed. SUMD: The diff ratio between total gain and total lose. VMA: Simple Volume Moving average. VSTD: The standard deviation for volume in past d days. WVMA: The volume weighted price change volatility. VSUMP: The total volume increase / the absolute total volume changed. VSUMN: The total volume increase / the absolute total volume changed. VSUMD: The diff ratio between total volume increase and total volume decrease.

(Above factors are copied from this source file.)

These factors are selected by the authors of Qlib, which is proved to be effective. But we know there are many other factors about economy and company financial status may also be useful. So, we could discuss this question here: What factor is useful for stock prediction.

Or to be more specifically, do you think the factors listed above is necessary? Are there any other factors likely to be helpful?

jingedawang commented 1 year ago

Hi @shawn1906 @SebastianMoreno1 , would you mind share your opinion about this?

SebastianMoreno1 commented 1 year ago

I like these metrics and believe that Beta will be one of the key metrics. In my opinion we can help predict the stock based on the overall market trend as well as lagging, current, or leading economic indicators too. Let me know if I can be more clear on this.

jingedawang commented 1 year ago

I like these metrics and believe that Beta will be one of the key metrics. In my opinion we can help predict the stock based on the overall market trend as well as lagging, current, or leading economic indicators too. Let me know if I can be more clear on this.

Could you provide a data source of them? We need to see what the data looks like and decide if we could add them as factors.

ebkxjoinMS commented 1 year ago

VMA: Simple Volume Moving average.

not only price, we should also consider the Volume.

SebastianMoreno1 commented 1 year ago

Yes, agreed.

On Mon, Aug 22, 2022 at 11:17 AM ebkxjoinMS @.***> wrote:

VMA https://www.barchart.com/education/technical-indicators/volume_moving_average: Simple Volume Moving average.

not only price, we should also consider the Volume.

— Reply to this email directly, view it on GitHub https://github.com/jingedawang/StockPredictor/issues/8#issuecomment-1222503339, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH4SNVHTM7BXASXJPWCWEFDV2OKW3ANCNFSM57H7XT4A . You are receiving this because you were mentioned.Message ID: @.***>

--

Kind regards,

Sebastian Moreno

LinkedIn https://www.linkedin.com/in/sebastianmo | @.*** | 630.991.8339

jingedawang commented 1 year ago

Yes, the last 6 factors are about volumns: VMA: Simple Volume Moving average. VSTD: The standard deviation for volume in past d days. WVMA: The volume weighted price change volatility. VSUMP: The total volume increase / the absolute total volume changed. VSUMN: The total volume increase / the absolute total volume changed. VSUMD: The diff ratio between total volume increase and total volume decrease.

SebastianMoreno1 commented 1 year ago

VMA is the one that really stuck out to me.

Let me know if you'd like to hop on a call at any point. I believe the other ones are helpful as well.

On Sun, Oct 2, 2022 at 9:33 AM Jinge Wang @.***> wrote:

Closed #8 https://github.com/jingedawang/StockPredictor/issues/8 as completed.

— Reply to this email directly, view it on GitHub https://github.com/jingedawang/StockPredictor/issues/8#event-7502263514, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH4SNVEKXAPJW3TCA5K7WQ3WBG2OVANCNFSM57H7XT4A . You are receiving this because you were mentioned.Message ID: @.***>

--

Kind regards,

Sebastian Moreno

LinkedIn https://www.linkedin.com/in/sebastianmo | @.*** | 630.991.8339