Step 1: Start with importing necessary libraries.
Step 2: Importing the data from NIFTY 50 .
Step 3: Creating indicators like 10-days moving average, correlation, relative strength index (RSI), the difference between the open price of yesterday and today, difference close price of yesterday and the open price of today, open, high, low, and close price which is used for prediction.
Step 4: Create the target variable which indicate profit or loss.
Step5 : Split the dataset into a training dataset and test dataset.
Step 6: Initiate logistic regression to predict profit or loss.
Step 7:Predict the class lables using predict function for the test dataset.
Step 8: Evaluvate the model and find the accuracy. use ‘score’ function and ‘crossvalscore’ function for finding accuracy.
Step 9: Create trading statergy using the model.