Thanks for reading the LinkedIn Posts and shown interest towards the technical understanding of the Markov Chain Modeling.
Basically, traders/analysts use several different approaches for prediction based upon fundamental analysis, technical analysis (TA), psychological analysis, etc. The technical analysis paradigm states that the price & volume relevant information is contained in market price itself. Researchers & Traders use these fundamental analysis / Technical Analysis specific metrics / indicators as their features and use different machine learning algorithms / statistical models based on Linear Regression / Logistic Regression / Decision tree etc., for price prediction.
In this post, I would like to share my experience of close price range Prediction (not exact the close price) with the previous days of OHLC historical data using Markov Chain Modeling. Many researchers in the past have used this technique for predicting a stock price movement based on the following 3 states viz., Up, Down, Same i.e., Closing of the Stock price will be upward compared to the Previous day's close; or downward or remains the same.
I have defined a new Model (working towards the next steps of model refinement; even thinking of whether I can patent it) based on new transition states (not the traditional ones) that are based on the historical OHLC levels of the stock as well as the Volume of the data and usage of Markov Chain Process.
For Example, please find the below illustrations,
Taken a sample of Strides Shasun Limited (STAR) from NSE & BSE (Thanks to NSE & BSE for providing daily Bhavcopy data) for a specific date range i.e., from 1st Feb 2016 till 17th March 2016 and calculated the Pivot Points, Resistance 1, Resistance 2, Resistance 3. Also defined the Transition state in a csv file as per the Definition provided above.
Attaching the snippet of the code in R to calculate the Markov Chain fit for the above and the expected High price range for 18th March 2016
As highlighted in blue, the expected Transstate for 18th March 2016 shall be R1 as it 0.5 (i.e., 50%) - so the high price for STAR on 18th March 2016 can be within range of 1042.58 to 1062.66 as highlighted in maroon in the snapshot.
Taken a sample of Strides Shasun Limited (STAR) from NSE & BSE (Thanks to NSE & BSE for providing daily Bhavcopy data) for a specific date range i.e., from 1st Feb 2016 till 17th March 2016 and calculated the Pivot Points, Resistance 1, Resistance 2, Resistance 3. Also defined the Transition state in a csv file as per the Definition provided above.
Attaching the snippet of the code in R to calculate the Markov Chain fit for the above and the expected High price range for 18th March 2016
As highlighted in blue, the expected Transstate for 18th March 2016 shall be R1 as it 0.5 (i.e., 50%) - so the high price for STAR on 18th March 2016 can be within range of 1042.58 to 1062.66 as highlighted in maroon in the snapshot.
On 18th March 2016, the high value for STAR in NSE is 1043.3 and BSE is 1043.
Based on the above similar transition states (defined by me), I am able to build a model using R which predicts the closing range of a specific stock based on previous day's data as well as historical data.
The markov process may not be powerful enough to produce the relevant accuracy of the closing price because it is important for you define the appropriate classification of states and the characterisation of the state (Transient / Closed states); and ensure the markov chain is composed of several transient and few Closed states. Also in the markov model, a random component is present, so that the state of the system at any point of time is not wholly dependent on the previous event or events. This particular aspect of Markov model when applied to Stock market (which is predominantly volatile at every minute) does not produce the desired results. Many researchers / analysts fail miserably in defining the states without the appropriate business knowledge and in appropriate assumptions on the data.
However this technique applied with the minute data and any level breaking either in the Support or Resistance and definition of right transition states shall determine you the Closing price range of a particular day well in advance.
However this technique applied with the minute data and any level breaking either in the Support or Resistance and definition of right transition states shall determine you the Closing price range of a particular day well in advance.
The below chart is the findings of the observation study(the % are not to be taken as actual)
In the case of change in the Closing price range, the traders can either take a call of converting to Delivery position if the loss is expected to be huge or even strategize in such a way that they dont make a loss on the intraday position.
Also, I want to mention that readers not to attempt these models or the findings /outcomes of the model directly in their actual trading and spending their money as the blog/posts covers only a snippet of the actual model and not advised to be used (either stocks or price movement and/or as recommendations for their trading).
Also, I want to mention that readers not to attempt these models or the findings /outcomes of the model directly in their actual trading and spending their money as the blog/posts covers only a snippet of the actual model and not advised to be used (either stocks or price movement and/or as recommendations for their trading).



No comments:
Post a Comment