Trader's Roundtable Forum Index Trader's Roundtable
A forum for mechanical system traders.
 
 FAQFAQ   SearchSearch  UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Filtering trade entry signals

 
Post new topic   Reply to topic    Trader's Roundtable Forum Index -> Trend Indicators and Signals
View previous topic :: View next topic  
Author Message
wonkabar
Full Member
Full Member


Joined: 01 Sep 2004
Posts: 20

PostPosted: Thu Sep 02, 2004 9:48 am    Post subject: Filtering trade entry signals Reply with quote

I have been toying with ideas on how to improve my trend following system entries. Part of this has got me thinking about various ways to filter trade signals so as to have a higher probablity of catching a "good" trend. What i have found is some people use rules such as only take longs if we are trading over x day moving average. Are there other schools of thought on the merits or demerits of adding filters? The Stridsman books explore adding filters to some systems with limited success.

If any one has any thoughts I would love to hear them. thanks
Back to top
View user's profile Send private message
garryboor
Full Member
Full Member


Joined: 13 May 2004
Posts: 14

PostPosted: Thu Sep 02, 2004 3:06 pm    Post subject: Reply with quote

The Veritrader 2.0 Beta Testers are working collaboratively on a system exercise "A3" which seems to show some promise. It is an intermediate term trendfollowing system, plus a filter. In general terms:
  • The filter indicates whether the very long term trend is bullish or bearish. It only has two outputs: Longterm trend bullish, Longterm trend bearish.
  • The trading system is extremely simple
    1. If (intermediate term system wants to go long) AND (longterm trend is bullish) THEN go long
    2. If (intermediate term system wants to exit long) THEN exit long no matter what the filter says
    3. If (intermediate term system wants to go short) AND (longterm trend is bearish) THEN go short
    4. If (intermediate term system wants to exit short) THEN exit short no matter what the filter says
In preliminary tests the filter removes more than half the trades of the unfiltered intermediate-term trading system, yet it increases CAGR, decreases maxDD, and increases MAR Ratio quite noticeably (1.5 times larger than without the filter).

What sort of filter would give only two possible outputs, Long term trend bullish or Long term trend bearish? Well, how about using a pure-reversal long term trading system as an indicator? If this long term trading system is Long then the indicatorr output is "bullish", and if the long term trading system is Short then the indicator output is "bearish". Voila. No rocket science. Try it for yourself and see what you get.
Back to top
View user's profile Send private message
wonkabar
Full Member
Full Member


Joined: 01 Sep 2004
Posts: 20

PostPosted: Fri Sep 03, 2004 9:03 am    Post subject: Reply with quote

That certainly does sound interesting and I will try it myself. How are you defining intermediate and longterm in days for these? thanks
Back to top
View user's profile Send private message
Hiramhon
Roundtable Fellow
Roundtable Fellow


Joined: 08 May 2003
Posts: 99

PostPosted: Fri Sep 03, 2004 3:01 pm    Post subject: Reply with quote

In my mind, the average trade of a "long term trend following system" lasts 3 months or longer (entry date to exit date), taking the average over all trades in all markets in the portfolio. However the average trade of an "intermediate term trend following system" lasts between 3 weeks and 9 weeks, entry to exit. Just my opinion.
Back to top
View user's profile Send private message
efficiency
Senior Member
Senior Member


Joined: 02 Jun 2004
Posts: 27
Location: Omaha Nebraska

PostPosted: Thu Oct 07, 2004 6:32 am    Post subject: Reply with quote

For long entry I use a 120 day HHV (6 months) when FILTERED with an ADX 14 above 30 and rising. My initial sell stop is 3 ATR (which flexes with volatility). Once I'm "in the money" meaning the inta-day low is above my basis, I tighten the stop to 2 ATR and ride the trend.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
sluggo
Roundtable Knight
Roundtable Knight


Joined: 11 Jun 2004
Posts: 2200

PostPosted: Fri Feb 23, 2007 5:11 pm    Post subject: Reply with quote

efficiency wrote:
For long entry I use a 120 day HHV (6 months) when FILTERED with an ADX 14 above 30 and rising. My initial sell stop is 3 ATR (which flexes with volatility). Once I'm "in the money" meaning the inta-day low is above my basis, I tighten the stop to 2 ATR and ride the trend.

I programmed your system into Blox and ran it on a portfolio of 110 futures markets. (Since you specified long-only trades, I'm guessing you originally conceived it for trading stocks rather than futures). With the parameters you specified, it is very solidly profitable. Fooling with the stops a little bit, sands off some of the jaggedy-ness and changes the shape of the equity curve. Enjoy. Maybe someone will try it out on stocks!

edit: a diligent Roundtable member found an error in the handling of stops for Short trades. Which, predictably, I didn't test very thoroughly because the emphasis was on Long trades (!). Live and learn. The fix is attached.



part1.png
 Description:
Figure 1. System test with parameters as specified by user "efficiency"
 Filesize:  52.49 KB
 Viewed:  6246 Time(s)

part1.png



part3.png
 Description:
Figure 2. System test with stop parameter values tweaked a little bit
 Filesize:  52.72 KB
 Viewed:  6246 Time(s)

part3.png



v2_efficiency_system.zip
 Description:
v2 of "Breakout with ADX filter" system

Download
 Filename:  v2_efficiency_system.zip
 Filesize:  2.06 KB
 Downloaded:  514 Time(s)

Back to top
View user's profile Send private message Send e-mail
drip007
Roundtable Fellow
Roundtable Fellow


Joined: 27 Nov 2006
Posts: 53

PostPosted: Tue Apr 03, 2007 3:36 pm    Post subject: Adding ADX Reply with quote

Can anyone show me how to add ADX to my system as a filter in Tblox? I simply want to filter out choppy markets and require that ADX be above 20 or 30 before entering a trade.

Thanks in advance.

D
Back to top
View user's profile Send private message
Tim Arnold
Site Admin
Site Admin


Joined: 06 Apr 2004
Posts: 5309
Location: Boston, MA

PostPosted: Tue Apr 03, 2007 4:33 pm    Post subject: Reply with quote

Sure. Take a look at the ADX System and you will see some good examples. Here is how you setup the ADX Indicator for use in the Blox Scripting.

Then you can setup an If/Then statement like this:

Code:
IF adxIndicator > adxTrendLimit AND
   positiveDirectionalIndicator > negativeDirectionalIndicator AND
   instrument.position <> LONG THEN
   
   IF useATRStops THEN
      broker.EnterLongOnOpen( instrument.close - averageTrueRange * atrStop )
   ELSE
      broker.EnterLongOnOpen
   ENDIF
   
ENDIF



adxindicator.gif
 Description:
 Filesize:  13.6 KB
 Viewed:  5875 Time(s)

adxindicator.gif



_________________
Your trade = Your choice
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Daedalus
Contributing Member
Contributing Member


Joined: 10 Jun 2010
Posts: 7
Location: Sydney, Australia

PostPosted: Fri Jul 02, 2010 1:28 am    Post subject: Reply with quote

Hi,

I'm new to TB, so I'm still feeling my way. I think I'm getting the hang of it though...

I downloaded this system and ran it, but it doesn't get anywhere near the CAGR for me. I get between 5-6% using the sample data futures, which is an order of magnitude less than the results shown above.

It makes me wonder if I've got something else fundamentally mis-configured.

My equity curve is attached.

I had to change the money manager to work in this version. Here's what I used:
Code:
VARIABLES: riskEquity, dollarRisk TYPE: money

if sizeofUnit > 0 then
   order.SetQuantity( sizeOfUnit )
else
   ' Compute the risk equity.
   riskEquity = system.tradingEquity * riskPerTrade
   
   ' Compute the dollar risk.
   dollarRisk = dist2stop * instrument.bigPointValue
   
   ' Set the trade size.
   IF dollarRisk = 0 THEN
      order.SetQuantity( 0 )
   ELSE
      ' *** Set the quantity to a MIMNIMUM of 1 ***
      order.SetQuantity( max(riskEquity / dollarRisk, 1) )
   ENDIF
   
   ' Reject the order if the quantity is less than 1.
   IF order.quantity < 1 THEN
      order.Reject( "Order Quantity less than 1" )
   ENDIF
endif


To help me test my fundamental settings, could someone let me know what kind of curve they got for the All Liquid Futures data in the sample please?


Thank you,

Daedalus



Efficiency system - All Liquid Futures.PNG
 Description:
Equity curve for All Liquid Futures, Efficiency System
 Filesize:  36.54 KB
 Viewed:  742 Time(s)

Efficiency system - All Liquid Futures.PNG



_________________
The world is divided into those people who think they are right.
Back to top
View user's profile Send private message
LeviF
Roundtable Knight
Roundtable Knight


Joined: 22 Dec 2003
Posts: 1008
Location: Des Moines, IA

PostPosted: Fri Jul 02, 2010 6:12 am    Post subject: Reply with quote

sluggo wrote:
...portfolio of 110 futures markets.
Back to top
View user's profile Send private message Send e-mail
sluggo
Roundtable Knight
Roundtable Knight


Joined: 11 Jun 2004
Posts: 2200

PostPosted: Fri Jul 02, 2010 6:57 am    Post subject: Reply with quote

Levi is correct, the benefits of diversification across MANY futures markets, at numerous exchanges on several continents, are dramatic. Buy some Global Futures historical data, try it, and see for yourself.

Meanwhile, I think Daedalus's replacement code for the UnitSize script might not have captured the original intention. An alternate way of writing the code (as a single line!) is shown in the image below. This is a very literal translation, word for word, of the original.

A software environment for Blox version 3.5 is also attached. This contains Blox, System, AND Simulation Suite. Make a backup copy of your entire TradingBlox folder, for safekeeping, so you can revert to its pristine condition before fooling with this system. Then ....

Copy EACH of the included files into your Blox setup and don't change any of them. (The Simulation Suite sets all parameters, both system parameters and also Global Parameters; and it sets the start date & end date). Update Sample Data to today. Running this suite will provide a potent illustration of the benefits of a large & globally diversified portfolio. (Which it does by showing lackluster performance of a not large and not globally diversified portfolio Smile )



bloxcode.png
 Description:
Another way to code the UnitSize script
 Filesize:  4.95 KB
 Viewed:  702 Time(s)

bloxcode.png



Give_This_A_Try.zip
 Description:
Complete backtesting environment for this system

Download
 Filename:  Give_This_A_Try.zip
 Filesize:  251.7 KB
 Downloaded:  35 Time(s)

Back to top
View user's profile Send private message Send e-mail
Daedalus
Contributing Member
Contributing Member


Joined: 10 Jun 2010
Posts: 7
Location: Sydney, Australia

PostPosted: Sun Jul 04, 2010 1:00 am    Post subject: Reply with quote

Hi Sluggo,

Thank you for putting this up, I get the picture. I see there's significant correlation between the number of trades and the success of the system.

To elaborate on my code above, the max(...) element was to bypass the < 1 contract filter i.e. to trade every signal. This was a remnant from a previous test. Apart from that I think the effect of the code is the same.

I'll now go in search of sample data with a wider range of markets...

Thanks for your help,

Daedalus

_________________
The world is divided into those people who think they are right.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Trader's Roundtable Forum Index -> Trend Indicators and Signals All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB 2.0.23 © 2001, 2008 phpBB Group