PureBytes Links
Trading Reference Links
|
Here is code for a long term trend following system. Plot weekly bars,
look to buy or sell at the most recent high or low that has not been
exceeded for at least 2 weeks. I *think* the code is correct, but then
that's me talking. Results for Bonds since 83 are below. Haven't tested it
on anything else. Trade at your own risk. -David
*************************
Vars: RefHigh(0), RefLow(0);
If PivotHighVS(1, High, 1, 2, 20) <> -1 Then Begin
Condition1 = True;
RefHigh = PivotHighVS(1, High, 1, 2, 20);
End;
If PivotLowVS(1, Low, 1, 2, 20) <> -1 Then Begin
Condition2 = True;
RefLow = PivotLowVS(1, Low, 1, 2, 20);
End;
If MarketPosition = 1 Then
Condition1 = False;
If MarketPosition = -1 Then
Condition2 = False;
If Condition1 Then
Buy at RefHigh Stop;
If Condition2 Then
Sell at RefLow Stop;
*********************************
Performance Summary: All Trades
Total Net Profit $75,687.50 Open position P/L($2,343.75)
Gross Profit $167,968.75 Gross Loss($92,281.25)
Total # of trades 67 Percent profitable 43.28%
Number winning trades 29 Number losing trades 38
Largest winning trade $22,156.25 Largest losing
trade($5,125.00)
Average winning trade $5,792.03 Average losing
trade($2,428.45)
Ratio avg win/avg loss 2.39 Avg trade (win &
loss)$1,129.66
Max consec. Winners 3 Max consec. losers6
Avg # bars in winners 23 Avg # bars in losers7
Max intraday drawdown ($14,843.75)
Profit Factor 1.82 Max # contracts held 1
Account size required $14,843.75 Return on account509.89%
---
|