NexusFi: Find Your Edge


Home Menu

 





Using Dow Theory indicator as a filter in automated strategies


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one nanobiotech with 3 posts (0 thanks)
    2. looks_two MWinfrey with 2 posts (14 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 christronic with 1 posts (1 thanks)
    1. trending_up 7,350 views
    2. thumb_up 22 thanks given
    3. group 8 followers
    1. forum 8 posts
    2. attach_file 6 attachments




 
Search this Thread

Using Dow Theory indicator as a filter in automated strategies

  #1 (permalink)
 
nanobiotech's Avatar
 nanobiotech 
Brisbane, Australia
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus/Zen-Fire
Trading: CL
Posts: 670 since Jun 2009
Thanks Given: 134
Thanks Received: 430

I have been trialling the Dow Theory indicator in some of my automated strategies and find that it could be a useful additional filter for entries and more importantly, for early exits.

However as always my programming skills let me down to see how I can use this as a filter in a strategy code.

If anyone can suggest a snippet I would appreciate their assistance.

Cheers,
Nano

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
PowerLanguage & EasyLanguage. How to get the platfor …
EasyLanguage Programming
Better Renko Gaps
The Elite Circle
Trade idea based off three indicators.
Traders Hideout
Exit Strategy
NinjaTrader
REcommedations for programming help
Sierra Chart
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
21 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #3 (permalink)
 
MWinfrey's Avatar
 MWinfrey 
Lubbock TX
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Stage 5 Trading
Trading: CL
Posts: 1,878 since Jul 2009
Thanks Given: 1,450
Thanks Received: 3,335


There are no exposed outputs the way it is currently writtern. So, you can't call this indicator from a strategy. However, it can be modified to allow outputs if I know what you want to use in a strategy. Also, if you want, contact me privately and we can work on it offline.

Reply With Quote
Thanked by:
  #4 (permalink)
 
MWinfrey's Avatar
 MWinfrey 
Lubbock TX
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Stage 5 Trading
Trading: CL
Posts: 1,878 since Jul 2009
Thanks Given: 1,450
Thanks Received: 3,335

I made a modification to the DowTheory indicator that plots the high/low lines as continuous so you can see what they were in the past.

Also, I am thinking you want this indicator to report bullish, bearish, or chop so you can test for the current condition in your strategy. So, I modified the code so you can do just that. I am attaching it here so you can review it before I post it in the downloads section.

Insert the following code in your strategy to test for the different market conditions.

 
Code
 
if (DowTheory_v1(10).Direction[0] == 1)  // test for a bullish condition
{
     // do something related to a bullish market
}
 
if (DowTheory_v1(10).Direction[0] == -1)  // test for a bearish condition
{
     // do something related to a bearish market
}
 
if (DowTheory_v1(10).Direction[0] == 0)  // test for a choppy condition
{
     // do something related to a choppy market
}

Attached Thumbnails
Click image for larger version

Name:	CL 01-11 (4 BetterRenko)  12_16_2010.jpg
Views:	779
Size:	70.1 KB
ID:	27027  
Attached Files
Elite Membership required to download: Dow_Theory_v1.zip
Reply With Quote
  #5 (permalink)
 
nanobiotech's Avatar
 nanobiotech 
Brisbane, Australia
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus/Zen-Fire
Trading: CL
Posts: 670 since Jun 2009
Thanks Given: 134
Thanks Received: 430


MWinfrey View Post
I made a modification to the DowTheory indicator that plots the high/low lines as continuous so you can see what they were in the past.

Also, I am thinking you want this indicator to report bullish, bearish, or chop so you can test for the current condition in your strategy. So, I modified the code so you can do just that. I am attaching it here so you can review it before I post it in the downloads section.

Insert the following code in your strategy to test for the different market conditions.

 
Code
 
if (DowTheory_v1(10).Direction[0] == 1)  // test for a bullish condition
{
     // do something related to a bullish market
}
 
if (DowTheory_v1(10).Direction[0] == -1)  // test for a bearish condition
{
     // do something related to a bearish market
}
 
if (DowTheory_v1(10).Direction[0] == 0)  // test for a choppy condition
{
     // do something related to a choppy market
}

Thanks Mike, I'll check it out.

Cheers,
Nano

Started this thread Reply With Quote
  #6 (permalink)
 
nanobiotech's Avatar
 nanobiotech 
Brisbane, Australia
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus/Zen-Fire
Trading: CL
Posts: 670 since Jun 2009
Thanks Given: 134
Thanks Received: 430


MWinfrey View Post
I made a modification to the DowTheory indicator that plots the high/low lines as continuous so you can see what they were in the past.

Also, I am thinking you want this indicator to report bullish, bearish, or chop so you can test for the current condition in your strategy. So, I modified the code so you can do just that. I am attaching it here so you can review it before I post it in the downloads section.

Insert the following code in your strategy to test for the different market conditions.

 
Code
 
if (DowTheory_v1(10).Direction[0] == 1)  // test for a bullish condition
{
     // do something related to a bullish market
}
 
if (DowTheory_v1(10).Direction[0] == -1)  // test for a bearish condition
{
     // do something related to a bearish market
}
 
if (DowTheory_v1(10).Direction[0] == 0)  // test for a choppy condition
{
     // do something related to a choppy market
}

Your version of the Dow Theory indicator looks great Mike. I think you should post it in the downloads section.

Cheers,
Nano

Started this thread Reply With Quote
  #7 (permalink)
 christronic 
Perth + WA/Australia
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES
Posts: 8 since May 2012
Thanks Given: 7
Thanks Received: 3


MWinfrey View Post
I made a modification to the DowTheory indicator that plots the high/low lines as continuous so you can see what they were in the past.

Also, I am thinking you want this indicator to report bullish, bearish, or chop so you can test for the current condition in your strategy. So, I modified the code so you can do just that. I am attaching it here so you can review it before I post it in the downloads section.

Insert the following code in your strategy to test for the different market conditions.

 
Code
 
if (DowTheory_v1(10).Direction[0] == 1)  // test for a bullish condition
{
     // do something related to a bullish market
}
 
if (DowTheory_v1(10).Direction[0] == -1)  // test for a bearish condition
{
     // do something related to a bearish market
}
 
if (DowTheory_v1(10).Direction[0] == 0)  // test for a choppy condition
{
     // do something related to a choppy market
}


I haven't looked at the indicator yet, but it is great to have guys like you on this forum.

I am slowly learning to program, and I can say the only reason I have been successful in doing so is because of examples of code from yourself and others.

Keep up the good work.

Reply With Quote
Thanked by:
  #8 (permalink)
 
Cachevary's Avatar
 Cachevary 
Russia,Khabarovsk
 
Experience: Beginner
Platform: NT
Trading: Gold
Posts: 407 since Feb 2014

Hello,

Could anyone please tell what the Period of 10 represents in this indicator?

Reply With Quote
  #9 (permalink)
 
Silver Dragon's Avatar
 Silver Dragon 
Cincinnati Ohio
Legendary Master Data Manipulator
 
Experience: Intermediate
Platform: TastyWorks / NT
Broker: TastyWorks /NT
Trading: FX, Stocks, Options
Posts: 2,107 since Feb 2011
Thanks Given: 6,422
Thanks Received: 5,238

Updated the indicator with line colors so it would be possible to see what the trend was in the past. I also gave the trend text better visibility in the top right hand corner.

FYI - I dabble in coding so there may be a more efficient way to write the code than I did. Feel free to update.

Robert




nosce te ipsum

You make your own opportunities in life.
Attached Files
Elite Membership required to download: Dow_Theory_V2_03_28_15.zip
Visit my NexusFi Trade Journal Reply With Quote




Last Updated on March 28, 2015


© 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