Go Back   NinjaTrader Support Forum > NinjaScript File Sharing > NinjaScript File Sharing Discussion

NinjaScript File Sharing Discussion Discussion for shared NinjaScript files.

NinjaTrader
Reply
 
Thread Tools Display Modes
Old 10-18-2007, 08:38 PM   #1
zoltran
Senior Member
 
Join Date: Nov 2005
Location: , Ontario, Canada
Posts: 400
Thanks: 0
Thanked 0 times in 0 posts
Default Ergodic

Please find attached the 'Ergodic' and the Ergodic Candlestick Oscillator from William Blau's book.

You would use the Ninja \File\Utilities\Import function to import the attached zip file.
Attached Images
File Type: png ergodic.png (72.9 KB, 1844 views)
Attached Files
File Type: zip Ergodic.zip (7.9 KB, 915 views)
Last edited by zoltran; 10-18-2007 at 08:44 PM.
zoltran is offline  
Reply With Quote
Old 10-18-2007, 09:13 PM   #2
NinjaTrader_JoshP
NinjaTrader Product Manager
 
NinjaTrader_JoshP's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,459
Thanks: 1
Thanked 379 times in 106 posts
Default

Interesting work zoltran. Thank you for the contribution. I'll need to go pick up Mr. Blau's book and see how this Ergodic.
NinjaTrader_JoshP is offline  
Reply With Quote
Old 10-19-2007, 07:22 PM   #3
whitmark
Vendor
 
whitmark's Avatar
 
Join Date: Nov 2005
Location: Virginia, USA
Posts: 464
Thanks: 6
Thanked 19 times in 13 posts
Default

Great work Zoltran . . . Blau's work has produced some really useful indicators and til now, have been noticably absent from Ninja. Thanks for your contribution.
whitmark is offline  
Reply With Quote
Old 10-21-2007, 02:30 PM   #4
KBJ
Senior Member
 
Join Date: Mar 2007
Location: , Florida, USA
Posts: 665
Thanks: 38
Thanked 13 times in 8 posts
Default

There are some instrucions in the souces that may make the Ergodic Oscillator more interesting...

Quote:
Description from Investor RT
http://www.linnsoft.com/tour/techind/custom/ergodic.htm

ErgodocOscillator = TSI
ErgodocOscillator Signal Line = EMA(TSI)
ErgodocOscillator Oscillator = TSI - EMA(TSI)

By default, TSI is setup with a Short Term of 5 and a Long Term of 20 and EMA is setup with a period of 5.

Trading Ergodics with the Trend - Rules

1. Enter or hold position only when slope of ErgodocOscillator Signal line has the same direction as the trend
2. Stand aside when slope of ErgodocOscillator Signal Line is in the opposite direction of trend
3. Enter or exit position when ErgodocOscillator and its Signal Line cross
KBJ is offline  
Reply With Quote
The following user says thank you to KBJ for this post:
Old 10-21-2007, 03:25 PM   #5
KBJ
Senior Member
 
Join Date: Mar 2007
Location: , Florida, USA
Posts: 665
Thanks: 38
Thanked 13 times in 8 posts
Default

Also, while figuring out the code, I added some comments to it, so I've attached an update for Ergodic.cs which should make it an easier read, and a beginner might have half a chance at understanding it.

Quote:
Shameless advertisement:

With adequate commenting of all of the NinjaTrader indicators, there would be much less simplistic questions on the forums, and a lot less load on NinjaTrader staff answering them, and even more people would flock to NinjaTrader because of the user friendliness.

My services are available.

Oh, and I could even do slightly better than this example, if I were being paid for it.
KBJ
Attached Files
File Type: zip Ergodic.zip (5.8 KB, 429 views)
KBJ is offline  
Reply With Quote
Old 10-21-2007, 06:11 PM   #6
edgeliner
Senior Member
 
Join Date: Oct 2007
Location: Southy Florida
Posts: 269
Thanks: 17
Thanked 1 time in 1 post
Default

KBJ.....

Can you upload your Ninjascript Strategy so that we can all comment on it and learn from it as well? I would personally like to implement it with my trading. Thanks!
edgeliner is offline  
Reply With Quote
Old 11-02-2007, 03:06 PM   #7
KBJ
Senior Member
 
Join Date: Mar 2007
Location: , Florida, USA
Posts: 665
Thanks: 38
Thanked 13 times in 8 posts
Default

This one isn't for the Ergodic, but I posted a strategy for the FastStochastic which the Optimizer was able to get 73% success out of. It needs lots of testing on other time frames and such.

Here it is: http://www.ninjatrader-support.com/v...ead.php?t=3615
KBJ is offline  
Reply With Quote
Old 12-05-2007, 03:50 PM   #8
saschja
Junior Member
 
Join Date: Aug 2007
Posts: 7
Thanks: 0
Thanked 0 times in 0 posts
Default Slingshot Indicator

I've been searching all over the forum for a slingshot indicator, but couldn't find such an indicator for Ninjatrader.

Anyone ?

Thanks in advance.

Saschja.
saschja is offline  
Reply With Quote
Old 12-05-2007, 08:16 PM   #9
zoltran
Senior Member
 
Join Date: Nov 2005
Location: , Ontario, Canada
Posts: 400
Thanks: 0
Thanked 0 times in 0 posts
Default Ergodoc Candlestick Oscilator

Adapted from Blau's Momentum/Direction/Divergence by zoltran (Wes S.)


The following is the Ergodic Candlestick Oscillator.
The ECO is a Momentum Oscillator that is not affected by opening gaps. See William Blau's Momentum/Direction/Divergence book.

It is used in a very similar manner to other Momentum indicators such as CCI, MACD or the Ergodic.

The 'Candlestick' part comes from the formula's use of just the open-close vs high-low.
It's primary advantage is that is not affected by Gap openings. It totally ignores them giving a better view of current momentum.

You can see this in the attached screen shots.
The trend was flat-to-down on 11/29. There was a gap open on 11/30 that ended up also being flat to down and eventually sold off.
The other indicators were all pegged high overbought/in the green due to the gap. The ECO pretty much ignored it. Same for 12/5.

There are some interesting strategies for using this indicator.
As they are on another charting programs web site.. I'll leave it to the reader to do a google for it. Try a search for ergodic candlestick histogram

/----------------------------------------
Trading Ergodics with the Trend - Rules

1. Enter or hold position only when slope of ECO Signal line has the same direction as the trend
2. Stand aside when slope of ECO Signal Line is in the opposite direction of trend
3. Enter or exit position when ECO and its Signal Line cross
4. Take note when the ECO is 'inside' it's signal line. This indicates failing momentum
This is what the magenta "Fading" dot signifies

// Formula for Candlestick oscilator from Blaus book is
// EMA(EMA(close-open),r),s)
// CSI(r,s)= 100 x --------------------------
// EMA(EMA(high-low),r),s)
//
// The 'Ergodic' version adds signal line, wich is a 5 bar ema of the CSI
//


(Cleaned up comments so KBJ doesn't scold me ;-) )


v1-4 -Fixed Plot Overflow- again Dec 18
Attached Images
File Type: png eco.png (73.3 KB, 1197 views)
Attached Files
File Type: zip ECO_V14.zip (4.8 KB, 443 views)
Last edited by zoltran; 12-19-2007 at 11:06 PM.
zoltran is offline  
Reply With Quote
Old 12-06-2007, 11:14 PM   #10
KBJ
Senior Member
 
Join Date: Mar 2007
Location: , Florida, USA
Posts: 665
Thanks: 38
Thanked 13 times in 8 posts
Default

Quote:
Originally Posted by zoltran View Post
(Cleaned up comments so KBJ doesn't scold me ;-) )
You've done well.
KBJ is offline  
Reply With Quote
Old 12-18-2007, 10:16 AM   #11
deanldavis475
Senior Member
 
Join Date: Feb 2006
Location: Poulsbo, Washington, USA
Posts: 231
Thanks: 9
Thanked 7 times in 7 posts
Default Great help thank you

1st a question. What determins if a bar is red or green and what causes the change. 2nd can you easlily tell me how to insert a line at plus 15 and at minus 15?? I love the indicator so far (2 days). Thanks
deanldavis475 is offline  
Reply With Quote
Old 12-18-2007, 10:58 AM   #12
zoltran
Senior Member
 
Join Date: Nov 2005
Location: , Ontario, Canada
Posts: 400
Thanks: 0
Thanked 0 times in 0 posts
Default

Green Bar = Rising ECO line .. ie the ECO line is greater than the prior bar
Red Bar = Falling ECO line
Same for the Ergodic Indicator

You can adjust the line levels when you add the indicator to the chart. Look for the 'Lines' section on the right of the Add Indicator dialogue .. just above where you change the color/size of the plots.

If you want an additional line, you can use the standard NT indicator called "Constant Lines" . It is used to place any arbirary line on chart/panel.
Apply it to the same 'panel' as your ECO, and adjust the line levels/color/formats as you wish.
zoltran is offline  
Reply With Quote
Old 12-18-2007, 01:24 PM   #13
deanldavis475
Senior Member
 
Join Date: Feb 2006
Location: Poulsbo, Washington, USA
Posts: 231
Thanks: 9
Thanked 7 times in 7 posts
Default

Thank you so much. I forget about the constant line indicator.
deanldavis475 is offline  
Reply With Quote
Old 12-18-2007, 07:32 PM   #14
deanldavis475
Senior Member
 
Join Date: Feb 2006
Location: Poulsbo, Washington, USA
Posts: 231
Thanks: 9
Thanked 7 times in 7 posts
Default One More Question

Any idea why I can get ECO to run on a tic chart of any number of tics, a 2 min chart but not a 1 min or a 3 min or any other min chart ??? Strange !!! The panel is just blank
deanldavis475 is offline  
Reply With Quote
Old 12-18-2007, 09:25 PM   #15
zoltran
Senior Member
 
Join Date: Nov 2005
Location: , Ontario, Canada
Posts: 400
Thanks: 0
Thanked 0 times in 0 posts
Default

Sorry,
It works fine here on all 3 types of charts. Have not had a problem.

Are there any entries in the NT log? For example Index out of bounds?
zoltran is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Request for Ergodic indicator LG Suggestions And Feedback 2 10-22-2007 04:58 PM


All times are GMT -6. The time now is 06:34 AM.

Futures, foreign currency and options trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing ones financial security or lifestyle. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results. View Full Risk Disclosure.

CFTC Rules 4.41 - Hypothetical or Simulated performance results have certain limitations, unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.

This website is hosted and operated by NinjaTrader, LLC (“NT”), a software development company which owns and supports all proprietary technology relating to and including the NinjaTrader trading platform. NT is an affiliated company to NinjaTrader Brokerage (“NTB”), which is a NFA registered introducing broker (NFA #0339976) providing brokerage services to traders of futures and foreign exchange products. This website is intended for educational and informational purposes only and should not be viewed as a solicitation or recommendation of any product, service or trading strategy. No offer or solicitation to buy or sell securities, securities derivative or futures products of any kind, or any type of trading or investment advice, recommendation or strategy, is made, given, or in any manner endorsed by any NT affiliate and the information made available on this Web site is not an offer or solicitation of any kind. Specific questions related to a brokerage account should be sent to your broker directly. The content and opinions expressed on this website are those of the authors and do not necessarily reflect the official policy or position of NT or any of its affiliates. 

Vendors along with their websites, products and services, collectively referred to as (“Vendor Content”), are independent persons or companies that are in no manner affiliated with NT or any if its affiliates. NT or any of its affiliates are not responsible for, do not approve, recommend or endorse any Vendor Content referenced on this website and it’s your sole responsibility to evaluate Vendor Content. Please be aware that any performance information provided by a vendor should be considered hypothetical and must contain the disclosures required by NFA Rule 2-29(c). If you are interested in learning more about, or investigating the quality of, any such Vendor Content you must contact the vendor, provider or seller of such Vendor Content. No person employed by, or associated with, NT or any of its affiliates is authorized to provide any information about any such Vendor Content.