Term - Regression Results ans = 0.0078 1.0945 -0.0000 -0.1332 -0.1963 -2.0644 0.7653 2.7589 -0.3459 -2.5557
The Adjusted R-squared is 2.00 percent
The Initial Sharpe Ratio is 0.14, this is for Lead = 4, Lag = 9, Holding Period = 0 (No Reverse Transaction)
Next Step Usually Takes 3 Minutes, Please Wait...
Elapsed time is 81.339232 seconds.
The Optimal Sharpe ratio is 0.68, this is for Lead = 20, Lag = 60, HoldingPeriod = 2
Total number of positions = 82
Average position duration = 2.19 periods
Average profit per position = $0.00
Maximum Drawdown = $0.56
从此结果我们可以得出结论The Optimal Sharpe ratio is 0.68, 据此我们可以根据Lead = 20, Lag = 60, HoldingPeriod = 2作为最佳优化位置,并根据MACD来判断与执行交易时机及仓位。 图1每次交易的收益或亏损 图2是三维空间里sharpe …show more content…
tbl=table(GoldStrip(1:end-1),slopeL(1:end-1,1:1),slopeL(1:end-1,2:2),slopeL(1:end-1,3:3),RawRet(2:end)); mdl = fitlm(tbl); Predicted_RawRet = mdl.Fitted; Predicted_RawRet=[0;Predicted_RawRet];
% Print Regression Statistics disp('Term - Regression Results'); [mdl.Coefficients.Estimate mdl.Coefficients.tStat] fprintf('\nThe Adjusted R-squared is %0.2f percent\n', 100*mdl.Rsquared.Adjusted);
Term - Regression Results ans = 0.0078 1.0945 -0.0000 -0.1332 -0.1963 -2.0644 0.7653 2.7589 -0.3459 -2.5557
The Adjusted R-squared is 2.00 …show more content…
Run Backtest
Select a range of values for the Lead, Lag and Holding Period parameters for the strategy Run a parameter sweep and compute Sharpe's ratios LEAD = 1:1:60; LAG = 1:1:60; HoldingPeriod =