The connection between risk and return is a critical concept in finance. Investors who take on more risk can earn higher returns. Disruptions are part of market risks, also known as systematic risks. Due to political and macroeconomic risks, their effects on the entire economic market, or a significant portion of its sectors, are not negligible. Among these sectors, the stock market is essential as a basis of the economy. The point is that the consequences of all disruptions are not merely unpleasant for companies. They may affect corporate profitability both negatively and positively. Hence, investors who trace companies' news and fundamental conditions react, and the closing price probably encounters volatility. Therefore, the common trend of several stocks may fluctuate. This research investigates how investors in the stock market should form their investment portfolio to see the minor losses when disruptions occur and take advantage of the potential provided profitability by turning threats into opportunities. A three-step framework is presented to achieve this goal. A prerequisite for this framework is the collection of relevant data. Ten stocks from distinct industries of the Securities and Exchange Organization of Iran are chosen for the examination. In the first step, multi-variate regression analysis categorizes selected stocks into the most and the least affected groups. At the same time, a comprehensive technical analysis is involved in this step. Then, in the second step, three well-known machine learning techniques, namely, stacked long short-term memory (Stacked LSTM), autoregressive integrated moving average (ARIMA), and Prophet, are compared from the point of view of predicting future closed prices of selected stocks. The method with the most minor statistical error in forecasting, i.e., root mean squared error (RMSE) and validation loss, estimates the next month's closed prices. Finally, based on the predicted closed prices, the third step empowers the investor to optimize their portfolio in different scenarios, containing various investment weights on the two obtained groups of the first step, using the Markowitz Modern Portfolio Theory. The COVID-19 pandemic and currency risk are the two examined real case studies to validate the proposed methodology. Numerical results based on the Sharp Ratio show the superiority of investing 75 percent of an asset in the most affected stocks and the rest in the least affected stocks in the case of a pandemic and vice versa for the case of currency risk, which reveals that according to the unique features of disruptions investors can benefit from both categories of stocks.