NexusFi: Find Your Edge


Home Menu

 





Building A Better Trend Filter


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one NW27 with 8 posts (11 thanks)
    2. looks_two Jeff65 with 6 posts (11 thanks)
    3. looks_3 bomberone1 with 4 posts (2 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
      Best Posters
    1. looks_one imPairsonator with 4 thanks per post
    2. looks_two Jeff65 with 1.8 thanks per post
    3. looks_3 NW27 with 1.4 thanks per post
    4. looks_4 bomberone1 with 0.5 thanks per post
    1. trending_up 16,141 views
    2. thumb_up 28 thanks given
    3. group 9 followers
    1. forum 21 posts
    2. attach_file 2 attachments




 
Search this Thread

Building A Better Trend Filter

(login for full post details)
  #11 (permalink)
 imPairsonator 
Thessaloniki, Greece
 
Experience: Beginner
Platform: QTS
Broker: IB
Trading: Equities, NQ
Posts: 166 since May 2012
Thanks Given: 104
Thanks Received: 395

I first encountered this approach here (an interesting paper overall, give it a read), named "moving average trend channel". I use it for some longer-term strategies, modified to use an EMAs instead of SMAs. One possible extension I've been thinking about is also adding a slope threshold to further reduce whipsaws.



EL code:
 
Code
inputs:
	length (200);
variables:
rho(0),
tau(0);

if rho = 0 then
	rho = c[1];

tau = iff(c > rho[1], 1, -1);
rho = iff(tau = 1, maxlist(Xaverage(l,length), rho[1]), minlist(Xaverage(h,length), rho[1]));


Plot1(rho, "Increasing", Green);
Plot2(rho, "Decreasing", Red);
Plot3(rho, "Chop", Cyan);
Plot4(rho, "MATC", iff(rho > rho[1], GetPlotColor(1), iff(rho < rho[1], GetPlotColor(2), GetPlotColor(3))));

NoPlot(1);
NoPlot(2);
NoPlot(3);

Follow me on Twitter Reply With Quote
The following 4 users say Thank You to imPairsonator for this post:

Can you help answer these questions
from other members on NexusFi?
IQFeed MBO data experience
The Elite Circle
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Volume profile TradeStation
EasyLanguage Programming
SPY ETF Question
Stocks and ETFs
Request for MACD with option to use different MAs for fa …
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Supertradersams Thread Journal on NQ/MNQ
27 thanks
GFIs1 1 DAX trade per day journal
24 thanks
Diary of a simple price action trader
17 thanks
Tao te Trade: way of the WLD
13 thanks
Deaddogs Stock Trading
12 thanks

(login for full post details)
  #12 (permalink)
 NW27 
Newcastle, Australia
 
Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker: IB
Trading: SPI,FTSE100, 6E, 6A
Posts: 285 since Oct 2010
Thanks Given: 108
Thanks Received: 188


Jeff65 View Post
This post almost slipped by me. It would be great if you could send me a copy of the code.

I probably should join. Another thing to look into. Item #2343 on the to-do list.

Thanks.

Well bugger me.

I just this minute (5min before posting this) noticed your web address below your name!

Over the last 3 days, I've been looking at info on your site with great interest.
I love what you have been doing. Great work.
No wonder I liked your thread. Please continue.

Funnily enough, I came across your site via a post in Traders Laboratory.
Somebody posted a question there and I responded with my FIRST post to Traders Laboratory.
In this post, I posted a link to futures.io (formerly BMT) where they could download the "NWT Exit Suite" I have developed.
Being the first post, it had to be vetted by the administrator. Guess what? The removed the link and references to futures.io (formerly BMT). How childish.

Neil.

Reply With Quote
The following 2 users say Thank You to NW27 for this post:
(login for full post details)
  #13 (permalink)
 bomberone1 
London
 
Experience: Beginner
Platform: MultiCharts
Posts: 277 since Nov 2010
Thanks Given: 14
Thanks Received: 29


I my opinion one of the best trend filter is the Butterworth filter

Butterworth filter design - MATLAB

Tr

Reply With Quote
The following 2 users say Thank You to bomberone1 for this post:
(login for full post details)
  #14 (permalink)
 NW27 
Newcastle, Australia
 
Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker: IB
Trading: SPI,FTSE100, 6E, 6A
Posts: 285 since Oct 2010
Thanks Given: 108
Thanks Received: 188


bomberone1 View Post
I my opinion one of the best trend filter is the Butterworth filter

Butterworth filter design - MATLAB

Tr

So what indicator do you have that you are basing this on?

Neil.

Reply With Quote
(login for full post details)
  #15 (permalink)
 bomberone1 
London
 
Experience: Beginner
Platform: MultiCharts
Posts: 277 since Nov 2010
Thanks Given: 14
Thanks Received: 29

This indicator is very good to filter a good trend.

Reply With Quote
(login for full post details)
  #16 (permalink)
 NW27 
Newcastle, Australia
 
Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker: IB
Trading: SPI,FTSE100, 6E, 6A
Posts: 285 since Oct 2010
Thanks Given: 108
Thanks Received: 188

Please post a chart with the indicator on it as well as the code for the indicator.
Neil

Sent from my GT-I9100T using Tapatalk 2

Reply With Quote
(login for full post details)
  #17 (permalink)
 bomberone1 
London
 
Experience: Beginner
Platform: MultiCharts
Posts: 277 since Nov 2010
Thanks Given: 14
Thanks Received: 29

I dont' have in mc, sorry.

Reply With Quote
(login for full post details)
  #18 (permalink)
 NW27 
Newcastle, Australia
 
Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker: IB
Trading: SPI,FTSE100, 6E, 6A
Posts: 285 since Oct 2010
Thanks Given: 108
Thanks Received: 188

How about displaying a chart with it on it.

Secondly post any code for whatever charting package you have.

Sent from my GT-I9100T using Tapatalk 2

Reply With Quote
(login for full post details)
  #19 (permalink)
 bomberone1 
London
 
Experience: Beginner
Platform: MultiCharts
Posts: 277 since Nov 2010
Thanks Given: 14
Thanks Received: 29

I have the same resources that you see on the link.

Reply With Quote
(login for full post details)
  #20 (permalink)
 NW27 
Newcastle, Australia
 
Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker: IB
Trading: SPI,FTSE100, 6E, 6A
Posts: 285 since Oct 2010
Thanks Given: 108
Thanks Received: 188


Please display a chart you use it on.

Sent from my GT-I9100T using Tapatalk 2

Reply With Quote





Last Updated on June 11, 2012


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts