A quick introduction: The codes are divided into two sets. The first set is running on MATLAB, solving the model without return correlation. The second set is written in Python, solving the model with return correlation. Matlab Codes These codes can be run on Windows. Functions: "PDESolver_CRRA_1Stock_ConstUnObsRet" This function solves the HJB equation involved by trading a single stock. It returns the trading strategies. The outputs should be saved for simulation purpose. "PDESolver_CRRA_1Stock_ConstUnObsRet_FRTax" This function solves the HJB equation involved by trading a single stock, but in the presence of capital gains tax. The outputs should also be saved for simulation purpose. "pathGenerator_ConstUnobsRet_1Stock" This function generates random paths for the stock. The random seed is set to the machine time (as default in Matlab). "OnePathMC_CRRA_MultiStocks_ConstUnobsRet_ApproximatePolicy" This function computes the related measures for one single simulated path. "MultiPathMC_CRRA_MultiStocks_ConstUnobsRet_ApproximatePolicy" This function calls "OnePathMC_CRRA_MultiStocks_ConstUnobsRet_ApproximatePolicy" and computes disposition effect-related measures for many simulated paths. "OnePathMC_CRRA_MultiStocks_ConstUnobsRet_ApproximatePolicy_Tax" This function computes the related measures for one single simulated path, in the model with capital gains tax. "MultiPathMC_CRRA_MultiStocks_ApproximatePolicy_Tax" This function calls "OnePathMC_CRRA_MultiStocks_ConstUnobsRet_ApproximatePolicy_Tax" and computes disposition effect measures along many simulated paths, in the model with capital gains tax. Executable Files: "MainFile_MC_CRRA_MultiStocks_ConstUnObsReturn_ApproximatePolicy" This execution file consists of two parts. In the first part, it calls the function "PDESolver_CRRA_1Stock_ConstUnObsRet" to generate trading policy. If the user wants to compute the trading strategy in the oberservable case, he/she can set the input V_0 to 0. In the second part, it calls "MultiPathMC_CRRA_MultiStocks_ConstUnobsRet_ApproximatePolicy" and computes related measures along many simulated paths. Notes: there are many flags in the list of inputs, such as DE_flag, ExpostRtn_flag, etc. If one wants to compute a specific measure, he/she can set the corresponding flag to "true." For example, by setting DE_flag=true, the code will calculate PGR and PLR; by setting DE_purchaseflag=true, the code will calculate PGPA and PLPA, etc. Expected run-time: 10-60 mins, depending on the parameter values and number of tasks. "MainFile_MC_CRRA_MultiStocks_ApproximatePolicy_Tax" This execution file consists of two parts. In the first part, it calls the function "PDESolver_CRRA_1Stock_ConstUnObsRet_FRTax" to generate trading policy. In the second part, it calls "MultiPathMC_CRRA_MultiStocks_ApproximatePolicy_Tax" and computes related measures along many simulated paths. Expected run-time: 60-180 mins, depending on the parameter values. Python codes: 1. Software and system: Softwares are python 3.6 and tensorflow 1.12. The main packages required in the codes are: pickle, tensorflow, numpy, scipy. The operating system is Linux. Codes are written for gpu. 2. For unobservable case, run 4d_gpu_Col_cost.py. For observable case, run 4d_gpu_Col_nolearning_cost.py. After getting the model and simulation test data, the user can check all the results by other python files independently. 3. The time for running the training part of the codes would be around 1 hour on a NVIDIA TITAN Xp gpu card. 4. Random seed is default seed.