Using IB as a broker, what would be the best way to automate the buy 100 SPY at the close each day and sell on the open each morning? Getting tired of doing this manually every day. Any advice for a beginner?
%% Yes; best way is to not exit so often- if you want a profit more than thrills. Rich ''turtle'' Dennis warned ''its the job of the market to wreck computer systems ''+ he used computer systems.
For 20 years of SPY, assuming $1 per trade commission, it's positive but not a barn burner. I'd say it's more like random. Instead just dollar cost average and hope the next 20 years are like the last 20! Formatting kinda sux but here ya go: Code: Long + Short Long Only Short Only Buy & Hold Starting Capital $100,000.00 $100,000.00 $100,000.00 $100,000.00 Ending Capital $108,118.99 $108,118.99 $100,000.00 $227,943.52 Net Profit $8,118.99 $8,118.99 $0.00 $127,943.52 Net Profit % 8.12% 8.12% 0.00% 127.94% Annualized Gain % 0.39% 0.39% 0.00% 4.20% Exposure 14.55% 14.55% 0.00% 100.00% Number of Trades 5,013 5,013 0 1 Avg Profit/Loss $1.62 $1.62 $0.00 $127,943.52 Avg Profit/Loss % 0.01% 0.01% 0.00% 127.69% Avg Bars Held 1.00 1.00 0.00 5,032.00 Winning Trades 2,644 2,644 0 1 Winning % 52.74% 52.74% N/A 100.00% Gross Profit $152,762.03 $152,762.03 $0.00 $127,943.52 Avg Profit $57.78 $57.78 $0.00 $127,943.52 Avg Profit % 0.41% 0.41% 0.00% 127.69% Avg Bars Held 1.00 1.00 0.00 5,032.00 Max Consecutive 10 10 0 N/A Losing Trades 2,369 2,369 0 0 Losing % 47.26% 47.26% N/A 0.00% Gross Loss $-144,643.03 $-144,643.03 $0.00 $0.00 Avg Loss $-61.06 $-61.06 $0.00 $0.00 Avg Loss % -0.44% -0.44% 0.00% 0.00% Avg Bars Held 1.00 1.00 0.00 0.00 Max Consecutive 10 10 0 N/A Max Drawdown $-5,177.00 $-5,177.00 $0.00 $-71,933.17 Max Drawdown % -4.88% -4.88% 0.00% -56.56% Max Drawdown Date 9/23/2011 9/23/2011 N/A 3/13/2013 Wealth-Lab Score 2.55 2.55 0.00 1.83 Profit Factor 1.06 1.06 0.00 INF Recovery Factor 1.57 1.57 N/A 1.78 Payoff Ratio 0.93 0.93 0.00 INF Sharpe Ratio 0.36 0.36 0.00 0.34 Ulcer Index 2.81 2.81 0.00 20.33 Wealth-Lab Error Term 0.93 0.93 0.00 14.33 Wealth-Lab Reward Ratio 0.42 0.42 N/A 0.29 Luck Coefficient 14.84 14.84 0.00 1.00 Pessimistic Rate of Return 1.00 1.00 0.00 0.00 Equity Drop Ratio 0.00 0.00 0.00 1.24