Quote from c.chugani:
Thanx man.
Shall be eagerly awaiting your helpful input.
Regards,
Chirag
I tried posting the following as an attachment but all the formating disappeared. Let's try it again:
The following spreadsheet template is for backtesting an eod stock trading strategy.
The first 7 columns are the free eod stock data from finance.yahoo.com
"999" is just a sample last-row number, not necessarily your actual last row.
The numbers of greatest interest are L4 (must be >=30 for statistical significance) and P4 (must be >1 for a useful strategy).
Cell Description
----------------------------------------
A1 âXYZâ { stock symbol }
A3 âDateâ
A4 { most recent date in backtest }
... ...
A999 { oldest date in backtest }
B3 âOpenâ
C3 âHighâ
D3 âLowâ
E3 âCloseâ
F3 âVolumeâ
G3 âAdj. Closeâ
H3 âTypical Priceâ { ... slippage from the open (ideal trade price) }
H4 @AVG(B4..D4)*G4/E4
... ...
H999 @AVG(B999..D999)*G999/E999
I3 âStrategy being testedâ
I4 { buy signal, sell signal, or hold (no action) }
... ...
J3 âMarket Positionâ { number of shares owned }
J4 @IF(I5={buy}#AND#J5<=0, @INT(O4/H4),
@IF(I5={sell}#AND#J5>=0,
@IF(B4=C4#AND#D4=E4, 0, -1*@INT(O4/H4)), J5))
... ...
J999 +100
K3 âTransaction Priceâ
K4 @IF(J4=J5, K5, H4)
... ...
K999 +H999
L3 âCompleted Trade Countâ
L4 @IF((I5={buy}#AND#J5<0)#OR#(I5={sell}#AND#J5>0), L5+1, L5)
... ...
L999 +0
M3 âEquity, last transactionâ
M4 @IF(J4=J5, M5, O4)
... ...
M999 +J999*K999
N3 âEquity, last completed tradeâ
N4 @IF(L4=L5, N5, O4)
... ...
N999 +J999*K999
O1 { completed-trade commission }
O3 âEQUITYâ
O4 @IF(L4=0, J$999*H4, M5 + J5*(H4-K5) - O$1*(G4/E4)*(L4-L5))
... ...
P3 "Buy-&-Hold Index"
P4 +O4/(J$999*H4)
... ...
Q3 "Winners Minus Losers"
Q4 +Q5 + @SIGN(N4-N5)
... ...
Q999 +0
R3 "% Winning Trades"
R4 @IF(L4=0, 0, 50*(Q4+L4)/L4)
... ...
S3 "Gross Profits"
S4 +S5 + @MAX(N4-N5, 0)
... ...
S999 +0
T3 "Profit Factor"
T4 +S4/@ABS(N4-S4)
... ...