Research Article
ML-Based Interconnected Affecting Factors with Supporting Matrices for Assessment of Risk in Stock Market
Input : company stocks , PredictedY | for i in company_stocks(0,1) do | Train data and Daily profit is computed in the column profit. | Order = [1 if signal > 0 else -1 for signal in Train['PredictedY']] | Place buy order for signal 1 else sell order for -1 | Profit = Train['company_stock'] Train['Order'] | Wealth = Train['Profit'].cumsum() | Test data and Proft of price fluctation method | Order = [1 if sig >0 else -1 for sig in Test['PredictedY']] | Place buy order for sig 1 else sell order for -1 | Profit = Test['company_stock'] Test['Order'] | Wealth = Test['Profit'].cumsum() | End for | Function performance() | For i in index[0] | do | Include The initial investment which is one price of company_stock. | Compute Sharpe Ratio on Train data and Test data | Output : Daily (dailyr.mean()/dailyr.std(ddof=1)) | Evaluate Maximum Drawdown in Train data and Maximum Drawdown in Test data | Output : (['Drawdown'].max()) | End for | Return Output | End function |
|