RSI Rotation System missed signal
Author: gfparker
Creation Date: 4/14/2010 10:23 AM
profile picture

gfparker

#1
I took one of the simple RSI Rotation models and added some code to exit the position on a parabolic stop or AutoProfitLimit (OCO order). The strategy takes a position in the 4 lowest RSI symbols in the dataset using a limit order on the revious days low. I want to limit the number of positions held at one time to 4 positions. I run the strategy once per day and put the orders in before the market opens. The stops work fine but when a position stops out, the strategy enters a new position the same day and I miss the entry because the buy order wasn't present in the Alerts that morning. I've tried to adjust the code so as to not enter a position on a day that an existing position stops out, but my code isn't working.

Here is the strategy
CODE:
Please log in to see this code.


Running the strategy on AA in the Dow 30 symbols dataset from 4/13/07 to 4/13/09, my trade history looks like below. As you can see on 5/2/07 the strategy takes a position in T and PG. Then on 5/3/07 it takes positions in MRK and AA. My total is 4 positions. On 5/7/07 the AA position is exited on a limit and on 5/10/07 the strategy takes a position in CSCO. All is fine, I'm at 4 positions. The first problem occurs on 5/22/07 when the strategy exits the T and PG positions on a StopLoss. The same day it takes positions in WMT and KO. If I were to look at the alerts the morning of 5/22/07, I would see the stoploss orders, but not the buy orders. If I look at the alerts 5/23/07 all I see are stoploss orders because the strategy already assumes I entered the new positions yesterday. I know it's because the strategy doesn't run in realtime, but is there anyway to delay the purchase of the new positions (in the code) until 5/23/07 so I get alerts for the buys? Thanks.


Position Symbol Quantity Entry Date Entry Price Exit Date Exit Price Profit % Profit $ Bars Held Profit per Bar Entry Name Exit Name MAE % MFE %
Long T 300 5/2/2007 38.70 5/22/2007 40.27 3.92 $455.00 15 $30.33 47.1536004424318 StopLoss -0.74 7.17
Long PG 200 5/2/2007 62.63 5/22/2007 62.83 0.19 $24.00 15 $1.60 42.0819491272039 StopLoss -2.60 2.81
Long MRK 200 5/3/2007 51.11 5/24/2007 53.30 4.13 $422.00 16 $26.38 49.2824603234668 StopLoss -0.29 7.81
Long AA 300 5/3/2007 34.75 5/7/2007 38.16 9.66 $1,007.00 3 $335.67 42.8442506300635 Limit -0.08 9.74
Long CSCO 400 5/10/2007 26.37 5/24/2007 25.65 -2.88 ($304.00) 11 ($27.64) 35.9294977489994 StopLoss -2.81 0.99
Long WMT 200 5/22/2007 46.57 6/12/2007 49.61 6.36 $592.00 15 $39.47 19.8400847461811 StopLoss -0.62 10.37
Long KO 200 5/22/2007 51.75 6/7/2007 51.37 -0.89 ($92.00) 12 ($7.67) 36.3951258558479 StopLoss -1.24 3.23
Long JPM 200 5/24/2007 51.93 6/8/2007 49.83 -4.20 ($436.00) 11 ($39.64) 39.6060650285582 StopLoss -4.29 0.65
Long MSFT 300 5/24/2007 30.54 6/8/2007 29.58 -3.32 ($304.00) 11 ($27.64) 41.7032398219908 StopLoss -3.23 1.94
Long MRK 200 6/7/2007 50.44 6/21/2007 49.05 -2.91 ($294.00) 11 ($26.73) 15.1268277340151 StopLoss -2.84 2.18
Long BAC 200 6/8/2007 49.74 6/25/2007 49.03 -1.59 ($158.00) 12 ($13.17) 14.5153749711607 StopLoss -1.67 2.11
Long DIS 300 6/12/2007 34.10 6/28/2007 33.86 -0.86 ($88.00) 13 ($6.77) 22.0124068738862 StopLoss -3.30 2.24
Long PFE 400 6/12/2007 26.22 6/26/2007 25.48 -2.97 ($312.00) 11 ($28.36) 26.1275897817119 StopLoss -3.55 1.64
Long TRV 200 6/21/2007 52.50 7/10/2007 53.29 1.35 $142.00 13 $10.92 24.5582338890745 StopLoss -1.07 5.26
Long MRK 200 6/25/2007 48.26 7/11/2007 48.50 0.33 $32.00 12 $2.67 19.5509638163437 StopLoss -0.62 5.80
Long VZ 200 6/29/2007 40.85 7/20/2007 41.60 1.64 $134.00 15 $8.93 25.4329405936738 StopLoss -2.11 5.46
Long CAT 100 7/5/2007 77.59 7/20/2007 79.75 2.58 $200.00 12 $16.67 35.667552764288 StopLoss -0.66 12.02
Long BAC 200 7/10/2007 48.60 7/24/2007 47.78 -1.85 ($180.00) 11 ($16.36) 33.6817701852657 StopLoss -1.77 3.21
Long TRV 200 7/16/2007 53.33 7/26/2007 50.51 -5.44 ($580.00) 9 ($64.44) 45.7500865782499 StopLoss -5.87 0.47
Long PFE 400 7/20/2007 24.93 8/1/2007 23.51 -5.86 ($584.00) 9 ($64.89) 25.3121387196294 StopLoss -5.82 1.40
Long HD 300 7/20/2007 39.50 8/1/2007 36.94 -6.62 ($784.00) 9 ($87.11) 34.9988332451915 StopLoss -7.11 -0.07
Long JPM 200 7/24/2007 46.63 8/3/2007 43.57 -6.73 ($628.00) 9 ($69.78) 25.9052237493303 StopLoss -7.44 -0.09
Long DD 200 7/26/2007 47.83 8/13/2007 48.13 0.46 $44.00 13 $3.38 22.9454072072205 StopLoss -4.43 4.41
Long MCD 200 8/1/2007 47.68 8/14/2007 47.66 -0.21 ($20.00) 10 ($2.00) 13.3934917534507 StopLoss -0.46 8.72
Long KFT 300 8/1/2007 32.57 8/16/2007 31.66 -2.96 ($289.00) 12 ($24.08) 20.4522862491678 StopLoss -6.41 1.08
Long AA 300 8/3/2007 37.10 8/15/2007 34.74 -6.50 ($724.00) 9 ($80.44) 23.635766122123 StopLoss -9.78 1.30
Long MMM 100 8/14/2007 85.75 9/7/2007 90.02 4.79 $411.00 18 $22.83 24.2191821733142 StopLoss -3.06 6.62
Long HD 300 8/15/2007 33.49 9/5/2007 36.24 8.05 $809.00 15 $53.93 22.4815948492993 StopLoss -4.98 15.00
Long DIS 300 8/16/2007 31.35 9/7/2007 33.63 7.10 $668.00 16 $41.75 21.2287782979144 StopLoss -0.40 9.90
Long WMT 200 8/23/2007 43.43 9/7/2007 42.33 -2.72 ($236.00) 11 ($21.45) 32.7060132507796 StopLoss -2.62 1.96
Long BA 100 9/5/2007 94.90 10/3/2007 104.93 10.40 $987.00 21 $47.00 39.0517700791673 StopLoss -1.01 12.82
Long BAC 200 9/7/2007 49.17 9/25/2007 49.94 1.40 $138.00 13 $10.62 40.1829013714514 StopLoss -1.24 5.53
Long HD 300 9/7/2007 34.81 9/21/2007 34.52 -0.99 ($103.00) 11 ($9.36) 42.4679848084012 StopLoss -4.13 6.65
Long JPM 200 9/7/2007 43.27 9/25/2007 45.79 5.64 $488.00 13 $37.54 42.8760639785968 StopLoss -0.25 10.98
Long HD 300 9/25/2007 33.18 10/11/2007 33.33 0.29 $29.00 13 $2.23 30.2292482565269 StopLoss -2.52 4.05
Long AXP 200 9/25/2007 58.18 10/15/2007 61.53 5.62 $654.00 15 $43.60 39.3458119620479 StopLoss -0.55 9.30
Long TRV 200 9/25/2007 49.32 10/15/2007 52.93 7.16 $706.00 15 $47.07 36.2830968832782 StopLoss -0.08 10.73
Long CVX 100 10/3/2007 91.51 10/19/2007 91.00 -0.73 ($67.00) 13 ($5.15) 47.3170085177242 StopLoss -1.56 2.57
Long BA 100 10/11/2007 97.04 10/24/2007 93.46 -3.85 ($374.00) 10 ($37.40) 22.4582351968783 StopLoss -4.66 0.48
Long KFT 300 10/15/2007 33.60 10/29/2007 32.65 -2.99 ($301.00) 11 ($27.36) 39.5686838127692 StopLoss -3.89 1.23
Long HD 300 10/18/2007 31.45 11/1/2007 30.66 -2.68 ($253.00) 11 ($23.00) 15.3810744704111 StopLoss -3.80 1.19
Long BAC 200 10/19/2007 47.76 11/1/2007 46.14 -3.56 ($340.00) 10 ($34.00) 14.1833413939091 StopLoss -3.48 1.63
Long MMM 100 10/29/2007 85.59 11/9/2007 79.98 -6.74 ($577.00) 10 ($57.70) 14.8229782208569 StopLoss -6.65 1.45
Long CAT 100 11/1/2007 73.25 11/13/2007 69.98 -4.68 ($343.00) 9 ($38.11) 44.1938912569692 StopLoss -5.26 2.46
Long PG 100 11/1/2007 69.04 11/26/2007 72.36 4.58 $316.00 17 $18.59 31.9385435868639 StopLoss -0.77 6.85
Long XOM 100 11/1/2007 89.83 11/13/2007 84.35 -6.28 ($564.00) 9 ($62.67) 47.2954990707024 StopLoss -6.87 0.66
Long IBM 100 11/9/2007 103.99 11/27/2007 101.84 -2.22 ($231.00) 12 ($19.25) 16.9459148131573 StopLoss -4.62 2.26
Long DD 200 11/15/2007 45.77 12/11/2007 47.13 2.80 $256.00 18 $14.22 27.2187496843688 StopLoss -4.41 4.76
Long BA 100 11/15/2007 91.46 12/4/2007 91.41 -0.23 ($21.00) 13 ($1.62) 27.2583192527936 StopLoss -5.24 3.35
Long T 300 11/27/2007 36.25 12/11/2007 40.56 11.74 $1,277.00 11 $116.09 20.7908896234215 Limit -0.07 11.82
Long CSCO 400 11/29/2007 27.80 12/17/2007 28.31 1.69 $188.00 13 $14.46 37.827982624463 StopLoss -3.60 6.55
Long MSFT 300 12/4/2007 32.68 12/28/2007 35.89 9.66 $947.00 18 $52.61 32.7669305431272 StopLoss -0.23 12.28
Long DIS 300 12/11/2007 32.27 12/28/2007 32.33 0.02 $2.00 13 $0.15 41.4697650663274 StopLoss -1.82 3.45
Long GE 300 12/11/2007 37.04 12/31/2007 37.22 0.34 $38.00 14 $2.71 49.9466132305093 StopLoss -2.47 2.90
Long HD 400 12/17/2007 26.50 1/3/2008 26.08 -1.74 ($184.00) 12 ($15.33) 21.3846335385043 StopLoss -3.58 2.83
Long BAC 200 12/28/2007 41.32 1/9/2008 38.38 -7.31 ($604.00) 8 ($75.50) 32.4142120583287 StopLoss -7.45 0.58
Long PFE 400 12/28/2007 22.90 1/17/2008 23.40 2.01 $184.00 14 $13.14 30.0265855643154 StopLoss -1.00 5.76
Long JNJ 200 1/3/2008 65.72 1/22/2008 64.67 -1.72 ($226.00) 13 ($17.38) 17.1296432353048 StopLoss -1.66 4.70
Long HPQ 200 1/8/2008 44.21 1/22/2008 40.50 -8.57 ($758.00) 10 ($75.80) 9.42046236612578 StopLoss -8.48 5.99
Long BA 100 1/9/2008 79.65 1/22/2008 74.53 -6.63 ($528.00) 9 ($58.67) 10.879232611078 StopLoss -6.53 4.34
Long PG 100 1/17/2008 68.76 1/30/2008 64.70 -6.14 ($422.00) 9 ($46.89) 11.3480442270375 StopLoss -8.87 -0.12
Long DIS 400 1/22/2008 27.18 2/6/2008 32.18 18.25 $1,984.00 12 $165.33 10.6898685011573 Limit -3.31 18.32
Long MMM 100 1/22/2008 72.07 2/8/2008 78.39 8.55 $616.00 14 $44.00 12.249107901268 StopLoss -0.14 12.97
Long UTX 100 1/22/2008 65.48 2/7/2008 71.16 8.43 $552.00 13 $42.46 13.3406116979361 StopLoss -0.55 13.52
Long MRK 200 1/30/2008 45.70 2/20/2008 46.82 2.28 $208.00 15 $13.87 20.1892399657383 StopLoss -3.37 5.45
Long MSFT 300 2/6/2008 28.89 2/21/2008 27.98 -3.33 ($289.00) 11 ($26.27) 14.762061237332 StopLoss -3.52 0.57
Long VZ 300 2/11/2008 35.85 2/20/2008 34.09 -5.06 ($544.00) 7 ($77.71) 23.5248286890312 StopLoss -4.98 8.46
Long HD 400 2/14/2008 28.13 2/29/2008 27.52 -2.31 ($260.00) 11 ($23.64) 47.2681375788529 StopLoss -4.30 4.76
Long T 300 2/20/2008 34.71 3/7/2008 34.69 -0.21 ($22.00) 13 ($1.69) 33.9834516230608 StopLoss -5.15 5.25
Long CSCO 400 2/20/2008 22.78 3/7/2008 23.90 4.74 $432.00 13 $33.23 31.4586473738184 StopLoss -0.40 10.32
Long GE 300 2/27/2008 33.77 3/10/2008 32.13 -5.01 ($508.00) 9 ($56.44) 44.0628840131579 StopLoss -5.29 0.66
Long MRK 200 2/29/2008 44.83 3/11/2008 41.28 -8.10 ($726.00) 8 ($90.75) 31.3716099473701 StopLoss -8.57 -0.09
Long JPM 300 3/7/2008 36.89 3/11/2008 39.04 5.68 $629.00 3 $209.67 12.7198175397543 Limit -1.64 5.76
Long BAC 300 3/7/2008 36.04 3/18/2008 38.48 6.62 $716.00 8 $89.50 9.66472441570261 Limit -5.04 7.86
Long BA 100 3/12/2008 72.39 3/28/2008 73.88 1.84 $133.00 12 $11.08 14.4347480220667 StopLoss -1.22 6.52
Long VZ 300 3/13/2008 34.20 4/7/2008 37.32 8.97 $920.00 17 $54.12 34.6471334187536 StopLoss -3.15 12.06
Long PFE 500 3/13/2008 21.16 3/31/2008 20.63 -2.66 ($281.00) 12 ($23.42) 31.8270265408255 StopLoss -4.66 0.68
Long CVX 100 3/20/2008 81.28 4/24/2008 92.77 13.94 $1,133.00 25 $45.32 31.7122196404937 StopLoss -0.60 16.33
Long MSFT 400 3/28/2008 28.00 4/14/2008 28.24 0.71 $80.00 12 $6.67 37.7510935343996 StopLoss -0.68 5.61
Long MRK 300 4/2/2008 38.04 4/17/2008 39.75 4.36 $497.00 12 $41.42 19.9407719616267 StopLoss -2.91 10.97
Long INTC 500 4/9/2008 21.04 4/16/2008 22.43 6.45 $679.00 6 $113.17 37.0698067329597 Limit -2.64 6.58
Long GE 300 4/14/2008 31.81 5/1/2008 32.65 2.47 $236.00 14 $16.86 13.9354975846134 StopLoss -0.90 5.73
Long PG 100 4/17/2008 68.72 5/2/2008 66.48 -3.49 ($240.00) 12 ($20.00) 30.0225893386606 StopLoss -4.37 -0.12
Long KO 200 4/21/2008 59.65 5/5/2008 58.37 -2.28 ($272.00) 11 ($24.73) 37.2544382228709 StopLoss -2.21 2.20
Long MMM 100 4/29/2008 76.87 5/15/2008 77.21 0.23 $18.00 13 $1.38 25.9604404267215 StopLoss -1.47 3.25
Long XOM 100 5/6/2008 89.26 5/23/2008 92.12 3.02 $270.00 14 $19.29 28.9591646921306 StopLoss -1.95 7.60
Long PG 200 5/6/2008 66.21 5/22/2008 65.32 -1.47 ($194.00) 13 ($14.92) 38.0360464084043 StopLoss -1.89 1.18
Long KO 200 5/7/2008 57.88 5/28/2008 57.67 -0.50 ($58.00) 15 ($3.87) 23.1476770172051 StopLoss -3.61 1.94
Long BAC 300 5/20/2008 35.65 6/2/2008 33.66 -5.73 ($613.00) 9 ($68.11) 30.7152847767863 StopLoss -6.81 -0.07
Long GE 300 5/22/2008 30.91 6/9/2008 30.23 -2.37 ($220.00) 12 ($18.33) 18.5362084953269 StopLoss -3.03 0.66
Long PFE 500 5/28/2008 19.25 6/6/2008 18.05 -6.40 ($616.00) 8 ($77.00) 18.7583581800457 StopLoss -6.32 1.42
Long XOM 100 6/2/2008 88.09 6/18/2008 87.91 -0.39 ($34.00) 13 ($2.62) 29.5230023179356 StopLoss -3.60 2.65
Long INTC 400 6/2/2008 23.05 6/11/2008 21.80 -5.60 ($516.00) 8 ($64.50) 34.9851160869034 StopLoss -5.51 4.03
Long BAC 300 6/6/2008 31.56 6/18/2008 28.85 -8.76 ($829.00) 9 ($92.11) 15.7961110974038 StopLoss -8.73 -0.08
Long PFE 600 6/11/2008 17.71 6/26/2008 17.74 0.02 $2.00 12 $0.17 9.15390307663567 StopLoss -2.39 4.61
Long MRK 300 6/13/2008 34.93 7/7/2008 37.56 7.38 $773.00 16 $48.31 14.5990690334054 StopLoss -1.34 11.29
Long GE 300 6/18/2008 28.70 6/27/2008 26.55 -7.68 ($661.00) 8 ($82.62) 21.7955538191497 StopLoss -7.72 -0.09
Long T 300 6/18/2008 35.53 6/27/2008 33.02 -7.21 ($769.00) 8 ($96.12) 23.4252701420452 StopLoss -7.14 0.09
Long KFT 300 6/26/2008 29.07 7/21/2008 29.46 1.16 $101.00 17 $5.94 16.8905583066974 StopLoss -3.63 3.11
Long MMM 100 6/27/2008 70.23 7/15/2008 68.60 -2.55 ($179.00) 12 ($14.92) 11.1840782471505 StopLoss -3.90 1.28
Long BA 200 7/1/2008 64.95 7/15/2008 62.06 -4.57 ($594.00) 10 ($59.40) 11.7510617917748 StopLoss -4.51 3.45
Long BAC 500 7/7/2008 21.72 7/8/2008 23.04 5.93 $644.00 2 $322.00 8.87043745765401 Limit -2.93 6.00
Long CAT 100 7/10/2008 68.33 7/25/2008 69.96 2.15 $147.00 12 $12.25 11.822932598164 StopLoss -3.75 10.92
Long HD 500 7/15/2008 21.30 7/23/2008 25.63 20.18 $2,149.00 7 $307.00 20.1299802933267 Limit -2.61 20.25
Long DIS 300 7/15/2008 28.82 7/31/2008 30.33 5.05 $437.00 13 $33.62 12.4554814650336 StopLoss -1.03 10.14
Long CVX 100 7/23/2008 85.13 8/5/2008 81.48 -4.48 ($381.00) 10 ($38.10) 23.618570336081 StopLoss -4.41 2.60
Long MRK 300 7/29/2008 31.95 8/19/2008 35.47 10.85 $1,040.00 16 $65.00 28.2195134896414 StopLoss -1.30 14.88
Long T 300 7/30/2008 30.56 8/14/2008 30.65 0.12 $11.00 12 $0.92 30.0340188552207 StopLoss -2.84 4.46
Long CAT 100 8/4/2008 67.87 8/19/2008 68.91 1.30 $88.00 12 $7.33 36.2061161107459 StopLoss -1.12 6.09
Long XOM 100 8/8/2008 76.90 9/2/2008 78.04 1.27 $98.00 17 $5.76 34.5640097930077 StopLoss -1.03 5.88
Long JPM 300 8/18/2008 37.36 9/4/2008 37.95 1.44 $161.00 13 $12.38 41.5736243682722 StopLoss -6.39 7.05
Long HPQ 200 8/19/2008 43.85 9/4/2008 44.99 2.42 $212.00 12 $17.67 35.4808738267713 StopLoss -1.28 8.89
Long IBM 100 8/19/2008 123.63 9/2/2008 118.48 -4.30 ($531.00) 10 ($53.10) 31.4536176015412 StopLoss -4.23 1.41
Long KO 200 9/2/2008 52.04 9/17/2008 52.77 1.25 $130.00 12 $10.83 24.2817751245744 StopLoss -1.69 7.09
Long INTC 500 9/4/2008 21.47 9/15/2008 19.46 -9.49 ($1,018.50) 8 ($127.31) 19.9357857634916 StopLoss -9.42 -0.07
Long AA 300 9/4/2008 29.12 9/11/2008 26.28 -9.94 ($868.00) 6 ($144.67) 24.5859774640352 StopLoss -10.15 1.45
Long IBM 100 9/4/2008 115.15 9/17/2008 112.66 -2.30 ($265.00) 10 ($26.50) 23.7103733158853 StopLoss -2.23 4.10
Long BA 200 9/11/2008 61.13 9/18/2008 56.36 -7.93 ($970.00) 6 ($161.67) 30.5173800561239 StopLoss -7.87 3.68
Long GE 400 9/15/2008 24.82 9/18/2008 25.03 0.68 $68.00 4 $17.00 28.0007778774512 Limit -10.80 2.38
Long INTC 500 9/17/2008 18.55 9/29/2008 18.38 -1.09 ($101.00) 9 ($11.22) 18.721297895427 StopLoss -3.54 8.92
Long T 300 9/17/2008 29.07 9/19/2008 31.12 6.87 $599.00 3 $199.67 23.0052678442266 Limit -5.46 6.96
Long PG 100 9/22/2008 68.15 10/6/2008 67.74 -0.84 ($57.00) 11 ($5.18) 34.4434321364113 StopLoss -3.27 5.44
Long MRK 300 9/23/2008 31.35 10/6/2008 30.46 -3.01 ($283.00) 10 ($28.30) 28.5902278246309 StopLoss -3.31 4.00
Long KO 200 9/23/2008 51.31 10/6/2008 50.35 -2.03 ($208.00) 10 ($20.80) 27.5491013929109 StopLoss -2.88 7.11
Long AA 400 9/29/2008 23.20 10/3/2008 20.74 -10.78 ($1,000.00) 5 ($200.00) 19.7947164313521 Limit -17.16 -0.09
Long CAT 200 10/3/2008 51.91 10/7/2008 52.65 1.27 $132.00 3 $44.00 15.941507290283 Limit -11.91 1.35
Long IBM 100 10/6/2008 101.21 10/10/2008 87.41 -13.79 ($1,396.00) 5 ($279.20) 22.953863176032 StopLoss -13.71 1.31
Long DD 300 10/6/2008 38.05 10/8/2008 38.63 1.38 $158.00 3 $52.67 22.924037839941 Limit -7.17 1.48
Long AA 600 10/8/2008 15.16 10/9/2008 15.74 3.65 $332.00 2 $166.00 11.1213421633103 Limit -11.70 3.74
Long DIS 400 10/8/2008 25.51 10/10/2008 22.24 -12.98 ($1,324.00) 3 ($441.33) 15.7974764530065 StopLoss -12.90 2.98
Long MMM 200 10/9/2008 57.24 10/13/2008 58.75 2.50 $286.00 3 $95.33 12.3571112541167 Limit -12.70 2.57
Long DD 300 10/10/2008 31.34 10/13/2008 35.74 13.87 $1,304.00 2 $652.00 9.54619674048885 Limit -1.78 13.95
Long JNJ 200 10/10/2008 55.40 10/13/2008 59.76 7.73 $856.00 2 $428.00 9.61686127732548 Limit -6.10 7.80
Long KFT 400 10/14/2008 28.14 10/17/2008 29.43 4.44 $500.00 4 $125.00 29.2984265718499 Limit -7.96 4.51
Long AA 800 10/15/2008 12.60 10/16/2008 12.13 -3.89 ($392.00) 2 ($196.00) 27.8347592957079 Limit -10.79 -0.08
Long BA 200 10/15/2008 43.61 10/23/2008 45.92 5.11 $446.00 7 $63.71 34.0825495593252 Limit -8.39 9.27
Long IBM 100 10/16/2008 87.71 10/24/2008 79.27 -9.81 ($860.00) 7 ($122.86) 26.3866228517045 StopLoss -9.71 9.26
Long DD 300 10/16/2008 31.92 10/20/2008 36.14 13.05 $1,250.00 3 $416.67 26.9426690925261 Limit -1.84 13.14
Long CAT 300 10/20/2008 39.00 10/23/2008 35.16 -9.98 ($1,168.00) 4 ($292.00) 23.3703728581954 StopLoss -9.91 5.96
Long AA 900 10/22/2008 11.69 10/24/2008 9.09 -22.39 ($2,356.00) 3 ($785.33) 33.9481415164659 StopLoss -22.32 -0.08
Long HD 500 10/23/2008 18.96 10/28/2008 20.24 6.58 $624.00 4 $156.00 31.3136495731341 Limit -7.36 6.67
Long HPQ 300 10/23/2008 34.29 10/28/2008 33.37 -2.84 ($292.00) 4 ($73.00) 27.0840168416207 Limit -12.50 -0.08
Long DD 400 10/28/2008 27.76 11/7/2008 28.97 4.21 $468.00 9 $52.00 21.6448131484666 StopLoss -0.90 19.85
Long CAT 300 10/28/2008 32.35 10/29/2008 37.40 15.45 $1,499.00 2 $749.50 16.5711227991483 Limit -1.16 15.53
Long AA 1,100 10/28/2008 9.03 10/29/2008 11.54 27.64 $2,745.00 2 $1,372.50 19.2617288754947 Limit -0.41 27.72
Long MSFT 400 10/31/2008 22.39 11/11/2008 21.29 -5.09 ($456.00) 8 ($57.00) 47.5345190198577 StopLoss -6.92 5.58
Long CAT 300 10/31/2008 36.25 11/4/2008 41.75 15.03 $1,634.00 3 $544.67 46.82142844817 Limit -0.49 15.10
Long JNJ 200 11/5/2008 61.31 11/13/2008 61.98 0.96 $118.00 7 $16.86 50.6962132610574 Limit -6.28 1.03
Long BAC 500 11/6/2008 21.56 11/12/2008 18.35 -15.04 ($1,621.00) 5 ($324.20) 39.6029174127774 StopLoss -15.43 -0.07
Long IBM 100 11/11/2008 82.74 11/19/2008 75.78 -8.61 ($712.00) 7 ($101.71) 33.3987007842391 StopLoss -8.97 3.12
Long DIS 500 11/11/2008 21.66 11/13/2008 21.58 -0.52 ($56.00) 3 ($18.67) 34.1623977687288 Limit -7.60 0.48
Long AXP 500 11/13/2008 19.75 11/21/2008 18.44 -6.79 ($671.00) 7 ($95.86) 21.7403539173699 Limit -16.28 8.78
Long GE 600 11/13/2008 16.05 11/20/2008 13.96 -13.19 ($1,270.00) 6 ($211.67) 23.7128358789935 StopLoss -13.10 6.40
Long BAC 600 11/17/2008 16.20 11/19/2008 13.36 -17.70 ($1,720.00) 3 ($573.33) 19.5828276529514 StopLoss -17.61 -0.08
Long JPM 300 11/19/2008 30.36 11/20/2008 25.02 -17.76 ($1,618.00) 2 ($809.00) 28.4605658907705 StopLoss -17.68 -0.09
Long BA 300 11/19/2008 38.04 11/21/2008 39.71 4.25 $485.00 3 $161.67 21.9091652087116 Limit -3.54 4.40
Long DD 500 11/21/2008 21.75 11/24/2008 24.65 13.19 $1,434.00 2 $717.00 16.8327317157655 Limit -2.05 13.26
Long BAC 900 11/21/2008 11.00 11/24/2008 12.59 14.29 $1,415.00 2 $707.50 9.10766583286645 Limit -9.08 14.37
Long CSCO 700 11/26/2008 15.20 12/8/2008 17.06 12.09 $1,286.00 8 $160.75 42.353771303823 Limit -3.27 12.16
Long UTX 200 11/26/2008 46.19 12/11/2008 46.96 1.49 $138.00 11 $12.55 44.9714448157603 StopLoss -2.55 9.24
Long BA 300 11/26/2008 39.35 12/5/2008 37.32 -5.29 ($625.00) 7 ($89.29) 43.1148403849028 StopLoss -5.23 8.70
Long DD 400 12/1/2008 24.27 12/8/2008 25.81 6.18 $600.00 6 $100.00 46.1525950604359 Limit -8.78 6.26
Long AA 1,300 12/5/2008 7.93 12/8/2008 8.81 10.94 $1,128.00 2 $564.00 34.0087485448174 Limit -6.02 11.02
Long MMM 200 12/8/2008 57.84 12/22/2008 56.53 -2.40 ($278.00) 11 ($25.27) 40.0301727911289 StopLoss -7.42 2.80
Long PG 200 12/10/2008 59.36 12/29/2008 60.09 1.10 $130.00 13 $10.00 36.3165355677062 StopLoss -3.96 4.67
Long AXP 500 12/11/2008 20.46 12/18/2008 18.59 -9.30 ($951.00) 6 ($158.50) 47.478626834097 StopLoss -10.49 1.00
Long TRV 200 12/11/2008 39.86 12/16/2008 42.86 7.33 $584.00 4 $146.00 47.3409670840505 Limit -6.77 7.43
Long BA 300 12/16/2008 38.20 1/8/2009 44.39 16.06 $1,841.00 16 $115.06 37.3179459792892 StopLoss -0.07 22.97
Long BAC 700 12/18/2008 14.50 12/24/2008 12.75 -12.23 ($1,241.00) 5 ($248.20) 44.0891737811355 StopLoss -12.35 -0.08
Long CVX 100 12/22/2008 70.84 1/9/2009 73.88 4.07 $288.00 13 $22.15 29.0611509005234 StopLoss -3.59 10.63
Long MMM 200 12/29/2008 55.51 1/13/2009 56.00 0.74 $82.00 11 $7.45 38.2678240641588 StopLoss -2.32 7.67
Long AXP 600 12/29/2008 17.62 1/6/2009 21.35 21.02 $2,222.00 6 $370.33 30.0382793950057 Limit -0.70 21.09
Long TRV 200 1/8/2009 41.21 1/20/2009 39.02 -5.51 ($454.00) 8 ($56.75) 32.4159356377832 StopLoss -7.18 3.57
Long JPM 400 1/8/2009 27.90 1/15/2009 24.79 -11.29 ($1,260.00) 6 ($210.00) 32.2432680664424 StopLoss -13.08 -0.07
Long BAC 900 1/13/2009 11.19 1/15/2009 9.32 -16.87 ($1,699.00) 3 ($566.33) 20.1332873398312 StopLoss -16.79 -0.08
Long PG 200 1/15/2009 57.09 1/30/2009 55.89 -2.24 ($256.00) 11 ($23.27) 18.3014729983031 StopLoss -2.70 3.28
Long GE 700 1/15/2009 14.02 1/21/2009 11.88 -15.43 ($1,514.00) 4 ($378.50) 17.6383485611979 StopLoss -15.35 2.20
Long T 400 1/15/2009 25.01 1/29/2009 24.56 -1.96 ($196.00) 10 ($19.60) 17.7388130303403 StopLoss -4.52 8.32
Long BAC 1,400 1/20/2009 6.48 1/21/2009 5.54 -14.68 ($1,332.00) 2 ($666.00) 6.98046552666935 Limit -22.16 -0.09
Long BAC 1,800 1/23/2009 5.37 1/26/2009 6.68 24.23 $2,342.00 2 $1,171.00 22.500652049796 Limit -1.39 24.31
Long WMT 200 1/28/2009 48.53 2/12/2009 47.98 -1.30 ($126.00) 12 ($10.50) 23.9551594403951 StopLoss -4.78 3.11
Long CAT 300 1/29/2009 32.61 2/6/2009 33.83 3.58 $350.00 7 $50.00 20.9140261997312 Limit -9.31 3.66
Long PFE 700 1/30/2009 15.02 2/10/2009 13.74 -8.67 ($912.00) 8 ($114.00) 19.0895085946345 StopLoss -8.60 2.32
Long GE 900 2/4/2009 11.32 2/9/2009 11.88 4.79 $488.00 4 $122.00 25.1716223050585 Limit -5.91 4.87
Long KFT 400 2/9/2009 25.92 2/19/2009 24.33 -6.29 ($652.00) 8 ($81.50) 30.3303534753348 StopLoss -6.75 -0.08
Long PG 200 2/10/2009 52.67 2/23/2009 49.45 -6.27 ($660.00) 9 ($73.33) 33.7122840483568 StopLoss -6.51 -0.08
Long XOM 100 2/12/2009 73.57 2/26/2009 71.14 -3.52 ($259.00) 10 ($25.90) 28.7508563713434 StopLoss -6.24 2.62
Long DIS 500 2/12/2009 18.26 2/23/2009 16.94 -7.40 ($676.00) 7 ($96.57) 28.9467551016595 StopLoss -7.32 3.42
Long AA 1,600 2/19/2009 6.38 2/24/2009 6.22 -2.66 ($272.00) 4 ($68.00) 17.0967986937062 Limit -9.17 0.71
Long CAT 400 2/23/2009 26.02 3/2/2009 23.44 -10.07 ($1,048.00) 6 ($174.67) 14.3276310697834 StopLoss -9.99 1.08
Long KFT 400 2/23/2009 23.28 3/4/2009 21.96 -5.84 ($544.00) 8 ($68.00) 15.0114070193475 StopLoss -6.66 3.87
Long BA 300 2/26/2009 33.22 3/3/2009 29.40 -11.66 ($1,162.00) 4 ($290.50) 19.867624011935 StopLoss -11.82 -0.08
Long UTX 200 2/26/2009 41.06 3/5/2009 37.69 -8.40 ($690.00) 6 ($115.00) 18.7101834130359 StopLoss -8.30 0.61
Long JNJ 200 3/2/2009 49.03 3/19/2009 49.60 1.00 $98.00 14 $7.00 12.6141325270628 StopLoss -5.75 5.12
Long MRK 400 3/4/2009 22.86 3/9/2009 20.15 -12.03 ($1,100.00) 4 ($275.00) 9.86146451784063 StopLoss -11.94 1.27
Long HPQ 400 3/9/2009 25.70 3/23/2009 30.87 19.96 $2,052.00 11 $186.55 19.2115082902619 Limit -1.28 20.04
Long PG 200 3/12/2009 44.76 3/30/2009 47.01 4.85 $434.00 13 $33.38 31.5899416710471 StopLoss -0.63 9.45
Long MRK 500 3/12/2009 21.80 3/13/2009 25.72 17.83 $1,944.00 2 $972.00 31.5222267292781 Limit -0.72 17.91
Long MCD 200 3/17/2009 51.55 4/7/2009 55.61 7.72 $796.00 16 $49.75 41.774342720219 StopLoss -0.45 10.61
Long TRV 300 3/25/2009 38.63 4/9/2009 41.04 6.10 $707.00 12 $58.92 53.387558481205 StopLoss -1.67 13.47
Long PFE 700 3/30/2009 13.88 Open Open -2.96 ($288.00) 10 ($28.80) 53.0751678229186 -3.90 2.12
Long IBM 100 3/30/2009 92.00 Open Open 8.55 $787.00 10 $78.70 47.392398687949 -0.30 11.50
Long JNJ 200 4/7/2009 51.67 Open Open -1.08 ($112.00) 4 ($28.00) 46.8116405085019 -1.37 0.68
profile picture

gfparker

#2
I think I have found the problem. For some reason the statement int y = ActivePositions.Count is returning 2 on 5/21/07 even though the open positions (look at trades) should be 4 (T,PG,MRK and CSCO). Is this a bug in WL5?
profile picture

Cone

#3
No.

T and PG exited on 5/22/2007. If you evaluate ActivePosition.Count after executing exit signals on the next bar, then those Positions will no longer be active on this bar. It's a peeking error to evaluate the ActivePosition list following trading signals. See WealthScript Guide: Programming Trading Strategies > Peeking > Trading based on Position Active Status