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 08-26-2007, 09:05 AM   #1
NinjaTrader_Ray
Founder and CEO
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,165
Thanks: 37
Thanked 341 times in 131 posts
Default Automatic Trend Line Detection and Alert

This is an indicator I published for the September 07 issue of S&C. This indicator is provided on an "as-is" basis.

To import:

- Download the file contained in this thread to your desktop
- From the Control Center window select the menu File > Utilities > Import NinjaScript
- Select the downloaded file
Attached Files
File Type: zip AutoTrendLine.zip (6.1 KB, 1455 views)
NinjaTrader_Ray is offline  
Reply With Quote
The following user says thank you to NinjaTrader_Ray for this post:
Old 08-27-2007, 08:55 PM   #2
BC5391
Junior Member
 
Join Date: Aug 2007
Posts: 18
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks Ray,

I did modify the alert, any wave file you want can be created here

http://public.research.att.com/~ttsweb/tts/demo.php
BC5391 is offline  
Reply With Quote
Old 09-19-2007, 10:57 AM   #3
prostyle
Junior Member
 
Join Date: Aug 2007
Posts: 29
Thanks: 0
Thanked 0 times in 0 posts
Default Trend Line Question

Hello,

You auto trend line is GREAT! I love it.

Have a question for you. How hard would it be
to devise a indicator that works the same type of
way but works with divergence?

Ie - plots the divergence between price action
and say macd or stoch or both :-)

Thanks,

Colin
prostyle is offline  
Reply With Quote
Old 09-21-2007, 12:29 AM   #4
RK_trader
Senior Member
 
Join Date: Jun 2007
Posts: 254
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks Ray for the auto trendline indicator.

When I tried to install it is trying to overwrite the default "swing"indicator, is this expected? Does it change swing indicator in anyway?

What does the "strength" field indicate? Does it indicate number of swing pivots needed for drawing the trendline?

Did you test whats the optimum strength field for ES 3 min chart. Appreciate your time on this.

Thanks
RK
RK_trader is offline  
Reply With Quote
Old 09-21-2007, 01:29 AM   #5
NinjaTrader_JoshP
NinjaTrader Product Manager
 
NinjaTrader_JoshP's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,459
Thanks: 1
Thanked 387 times in 108 posts
Default

The reason it is trying to overwrite the Swing indicator is because the way the export NinjaScript is designed is to allow the export file to work on its own. You can safely overwrite your Swing indicator as it is the same file. There will be no changes done.
NinjaTrader_JoshP is offline  
Reply With Quote
Old 09-21-2007, 06:59 AM   #6
NinjaTrader_Ray
Founder and CEO
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,165
Thanks: 37
Thanked 341 times in 131 posts
Default

Strength represents the number of bars left and right of a pivot required to form a pivot. I have not done any optimization to determine best values on any time frame.
NinjaTrader_Ray is offline  
Reply With Quote
Old 09-21-2007, 07:08 AM   #7
RK_trader
Senior Member
 
Join Date: Jun 2007
Posts: 254
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks Josh. I appreciate it.

Do you know what the "strength" field indicates? Does it indicate number of swing pivots needed for drawing the trendline?

Did you test whats the optimum strength field for ES 3 min chart. Appreciate your time on this.

Thanks
RK
RK_trader is offline  
Reply With Quote
Old 09-30-2007, 11:14 PM   #8
RK_trader
Senior Member
 
Join Date: Jun 2007
Posts: 254
Thanks: 0
Thanked 0 times in 0 posts
Default

Hi

Any active users of this auto trendline indicator, did you experiment with what "strength" property value you are getting good results? I tried 5 and not sure if it is good.

Also when does it give the signal. Does it wait for atleast one bar to close below the current trendline?

Josh thanks for good indicator. I am not a Ninja programming expert, trying to learn the indicator programming. Is it possible you can modify the indicator to include a property field "the number of bars to close below trendline to give signal"

Also I would like to request if you are considering enhancements to make the trendline a little below the swing lows with a "displacement". For example in an uptrend the trendline is joining the swing low pivots. I am finding that if the trendline is a bit conservative and like a few ticks below the swing lows, it is holding well. For example, if the swing lows in ES uptrend are like 1531.50, 1535.50, 1540.50, then a line joining 1531.25 ,1535.25,1540.25 with 0.25 displacement to downside is holding really well and when it breaks, it gives a very strong signal and doesn't give false signals. May be this can be enhanced by adding a "displacement field" to properties.

I appreciate your time and any active users opinion on this.

Thanks
RK
RK_trader is offline  
Reply With Quote
Old 09-30-2007, 11:20 PM   #9
NinjaTrader_JoshP
NinjaTrader Product Manager
 
NinjaTrader_JoshP's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,459
Thanks: 1
Thanked 387 times in 108 posts
Default

Unfortunately I cannot provide assistance on this indicator RK_trader. It wasn't me who programmed this one and so I do not know what the parameters do or mean.
NinjaTrader_JoshP is offline  
Reply With Quote
Old 09-30-2007, 11:46 PM   #10
RK_trader
Senior Member
 
Join Date: Jun 2007
Posts: 254
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks Josh for the quick reply. No problem.

I would appreciate opinions/comments on people who are actively using this indicator. Any volunteers who can modify the code to get the enhancements/options.

Thanks
RK
RK_trader is offline  
Reply With Quote
Old 10-01-2007, 02:33 PM   #11
NinjaTrader_Ray
Founder and CEO
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,165
Thanks: 37
Thanked 341 times in 131 posts
Default

The indicator waits for the first value lower or higher than a uptrend or downtrend line. If the indicator's "Calculate on bar close" is set to true, it will wait for a close of the bar otherwise just the first tick.

Unfortunately I will not be ammending the code to provide extra user defineable parameters however, anyone can take this open source code and modify it as they wish.
NinjaTrader_Ray is offline  
Reply With Quote
Old 10-01-2007, 09:24 PM   #12
RK_trader
Senior Member
 
Join Date: Jun 2007
Posts: 254
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks Ray. I am still in learning phase of Ninja programming.

I see "calculateonbarclose" on line 42 in Initialize() and it is set to true

And the other place I see it is on line 298 which says as below:

indicator.CalculateOnBarClose = CalculateOnBarClose;

Can you please clarify as to in which line, I need to change the value to true, so that it waits for a a bar to close below the trendline to give the alert.

Appreciate your time on this.

Thanks
RK
RK_trader is offline  
Reply With Quote
Old 10-02-2007, 07:53 AM   #13
NinjaTrader_Ray
Founder and CEO
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,165
Thanks: 37
Thanked 341 times in 131 posts
Default

Line 42 should be set to 'true'.
NinjaTrader_Ray is offline  
Reply With Quote
Old 10-02-2007, 09:59 AM   #14
RK_trader
Senior Member
 
Join Date: Jun 2007
Posts: 254
Thanks: 0
Thanked 0 times in 0 posts
Default

Hi Ray,

In line 42, it is already set to true.

Thanks
RK
RK_trader is offline  
Reply With Quote
Old 10-17-2007, 08:03 AM   #15
APat1
Junior Member
 
Join Date: Oct 2007
Posts: 11
Thanks: 0
Thanked 1 time in 1 post
Default

If it is set tof alse the calcs are on incoming tick basis.
Probably can change it in the indicator prop window.
Pat
APat1 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
Automatic Trend Line Indicator Greg1 Platform Technical Support 6 07-23-2009 07:48 AM
Pattern detection via indicator nybangali Indicator Development 6 08-20-2007 12:52 AM
CCI w/ Audible Alert Jibu V Indicator Development 12 08-03-2007 11:08 AM
Alert() AO76 Strategy Development 5 05-27-2007 09:21 AM
Line "names" in Indicator Box change to "Line" after modification higler Platform Technical Support 3 05-02-2007 06:05 AM


All times are GMT -6. The time now is 01:32 PM.

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.