StockFetcher Forums · View by Author: (14 messages)  [ Display By: Date / Subject ]<< 1 2 >> 
Backtesting Support · Exit criteria dependent on entry price
saratur
msg #95336
modified
8/3/2010 4:11:50 AM

How do I define for a backtest an exit criteria dependent on the entry price - beyond simple percentage?
In other words, exit dependent on an indicator calculated at the entry trigger date.
For example, how would I set a stop for entry price less 2 * ATR (10) which are calculated at the time of entry.

Backtesting Support · Exit price upon exit test trigger
saratur
msg #95335
8/3/2010 4:08:11 AM

The default setting of the backtester uses for exit upon Exit Tests the open price following the date of the exit trigger.
How do I set the exit price to be the close on the same day of the exit trigger?

If I set Exit Price (in "Advanced") to "close" - I am not sure if it will use the close of the trigger day, or the following day...


Backtesting Support · Exit price upon exit test trigger
saratur
msg #95487
8/6/2010 2:19:01 PM

Wantonellis - thank you.
I take it there is no way to set the exit price to be the close on the exit trigger day...

Filter Exchange · MODIFIED CONNORS RSI(2) FILTER
saratur
msg #95010
7/23/2010 3:14:01 AM

Kevin - I am new here. It is great to see your thread. Thanks for your detailed sharing. Some time ago I thought of testing the same general approach (trading a long/short basket of stocks based on mean reversion Connors type filters) - but never got myself to start the effort. Your thread is an excellent motivator.

Some reasons I hesitated: Mean reversion trading typically does better with very wide stops; also there are periods in the market when such strategies do not work well. Getting caught in such a period with wide stops could lead to high drawdowns, contradictory to my goal of low volatility (or better yet, low downward deviation) system. The portfolio approach will reduce volatility if the trades are not very correlated - but I do not have a feel to what extent they would be. Long/Short should reduce risk - but I do not know to what extent one could always find (and get filled) sufficient trades on both sides.

Your test shows excellent results so far. It is especially encouraging to see it is working with tighter stops.
At the same time - this is an unusually volatile period. Some trades could have worked just on account of the overall market movement. I would like to try and find out how such system could behave in a trending market, on both the long and short sides.

So far I figured out only the basics of Stockfetcher. This leads to a question:
Does StockFetcher has any means to backtest with stops and targets set individually for each stock?
Of what I found until now, it appears I could use a filter for historical stock selection, but will need to test the trades manually.

Filter Exchange · MODIFIED CONNORS RSI(2) FILTER
saratur
msg #95011
7/23/2010 4:16:35 AM

I think you can't place a stop loss and limit order on a stock you haven't purchased yet. If you use the r1/s1 pivots for entry, the corresponding stop and limit positions will not change. You can enter them after the trade is triggered.

Not sure if there are brokers who can do what you are asking. Maybe others can comment?

++++

You can do this at Interactive Brokers.
One can create a limit order to enter the trade, and attach to it 'bracket' order.
The 'bracket' is conditioned on the entry trade being filled, and is composed of a "one cancels another' pair of stop and limit orders that can be set to the predetermined stoploss and target.

Interactive Brokers, by the way, has excellent features and execution, and might be a better fit than Fidelity for this type of trading . In addition to the complex order types, commissions are lower if trades are of a moderate size. It is 0.5 cent/share with $1 minimum. In Kevin's test example, the average commission will probably be less than $2 vs. $7.95 at Fidelity.
Also, If one has a long/short dollar neutral strategy that seems to have low enough volatility and risk to justify trading it on margin: Unlike Fidelity and many other brokerages, at IB short proceeds offset margin debt. The strategy could be implemented without paying margin interest.


Filter Exchange · MODIFIED CONNORS RSI(2) FILTER
saratur
msg #95332
8/3/2010 3:06:01 AM

Kevin - great thread, I start looking at the individual trades :-).

In this test, how do you handle stocks that gap beyond the stoploss?
Looking at HMC : It opened 8/2 at 32.44, beyond the trigger and the planned stoploss.
If orders were placed the night before as limit with brackets (as defined, without any additional condition) the short would have been filled at the open. If the stop has had the fixed value of 32.28 it would probably be rejected , so HMC would be short now without a set stop. If a stop were to be placed at 0.8% relative to the entry, the short would have been stopped out.
Or - do you avoid gap pullbacks which are beyond s2 ? If this is the case, would you modify the entry points?

Filter Exchange · MODIFIED CONNORS RSI(2) FILTER
saratur
msg #95363
8/4/2010 3:41:04 AM

Kevin - same here, I have a strong preference to automated systems. It is possible to automate your original approach as well, with some effort and/or expense. So a key question in my mind is whether one approach will yield significantly better risk-adjusted returns than the other: (A) buy at open, wide stops, or (B) limit buys on some pullback, tight stops, or (C) something else.

In general mean reversion systems work better with wide stops. It might be though that in the context of a long-short system the tight stops with higher targets work well - especially when there are daily moves that trigger both the stops and profit targets.
The answer might be different under different market conditions, and I would like to backtest . Still trying to figure out if I could automate the backtest , or will have to do that manually.

Filter Exchange · MODIFIED CONNORS RSI(2) FILTER
saratur
msg #95364
8/4/2010 3:45:45 AM

Cross-posting from backtest support forum - maybe someone here knows the answers:

===
The default setting of the backtester uses for exit upon Exit Tests the open price following the date of the exit trigger.
How do I set the exit price to be the close on the same day of the exit trigger?

If I set Exit Price (in "Advanced") to "close" - I am not sure if it will use the close of the trigger day, or the following day...

====

How do I define for a backtest an exit criteria dependent on the entry price - beyond simple percentage?
In other words, exit dependent on an indicator calculated at the entry trigger date.
For example, how would I set a stop for entry price less 2 * ATR (10) which are calculated at the time of entry.

Filter Exchange · MODIFIED CONNORS RSI(2) FILTER
saratur
msg #95716
8/18/2010 12:28:59 AM

Kevin - I have done some backtesting on the long-short system with your composite filters, at one month granularity

So far I completed one year back. The simulated returns are significantly lower than the long term returns you received for the individual filters, or from what one may extrapolate from the real time test on this thread. It might be due to variation in exits or other parameters, market unfavorable to the system during this year – or errors in my backtest. To some extent I hope for the latter…

Kevin – and/or anyone else following this thread – could you please check my results (all, or just a spot-check). If more details on the backtest will be useful, please post or email me at saratur2@gmail.com

I could not figure out a way to test with StockFetcher stops and targets based on the ATR of each stock, or something similar. If anyone knows how to do this, please yell  .
In the test below I used fixed 3% stoploss 6% target. I did get somewhat better results using Connors’ standard 5 DMA exit and/or limited trade length.

Test:
Kevin’s composite filters, select by Composite score, top 5 (each long and short).
Exits: Stoploss 3%, Profit target 6%, maximum 5 days .
Price > $1 . I have relaxed volume to 200k shares (sinced I have noticed that some stocks in Kevin’s real time test are at lower volume than the original 500k ).
Return is calculated for each month, using SF daily backtest estimated equity. A backtest of 4 months was used to derive the results for each quarter so as to minimize effects of discontinuity in stock selection.
Results do not include commissions nor short borrow fees.

Month end Long Short Long-Short Equity
7/30/2010 1.77% 2.52% 2.14% 1.002782472
6/30/2010 -7.43% -2.28% -4.86% 0.981754416
5/28/2010 -5.76% -14.12% -9.94% 1.031857827
4/30/2010 0.82% 4.00% 2.41% 1.145775539
3/31/2010 12.54% 13.47% 13.01% 1.118824742
2/26/2010 6.54% -5.31% 0.62% 0.990050484
1/29/2010 -5.95% -0.14% -3.05% 0.983998808
12/31/2009 5.13% -1.22% 1.96% 1.014912788
11/30/2009 3.03% 4.35% 3.69% 0.995433964
10/30/2009 -9.29% -0.11% -4.70% 0.960003596
9/30/2009 6.13% 0.45% 3.29% 1.007346035
8/31/2009 -5.47% 0.52% -2.48% 0.975236619

average: 0.17% 0.18% 0.17%

The average monthly return is 0.17%, total gain after one year 0.28% .
After commissions this would be a loss - which could vary widely, depending on the brokerage. Each position turns over appx 80 times a year. If commissions are $4/trade, at $5000 per positions those will be 12.8% / year .


Filter Exchange · MODIFIED CONNORS RSI(2) FILTER
saratur
msg #95861
8/27/2010 2:44:23 AM

Kevin - great work, thank you for sharing. Very encouraging results.

Questions regarding parameter optimization with StrataSearch (I am not familiar with it):
- does it allow user defined target/fitness function, and/or 'canned' system oriented measures (e.g. Van Tharp's Health, linear correlation etc.) - or net profit only?
- any robustness tests via parameter sensitivity, and/or walk forward optimizations?
... and if yes, did you get to do such tests with these filters?





StockFetcher Forums ·  · << 1 2 >>

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2018 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.