NT Script Help for itrend. - NinjaTrader Programming | futures.io
futures.io futures trading

Go Back   futures.io

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader > NinjaTrader Programming

NT Script Help for itrend.
Started:October 17th, 2011 (12:35 PM) by sudhirc Views / Replies:687 / 3
Last Reply:October 17th, 2011 (12:54 PM) Attachments:0

Welcome to futures.io.

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community. It's free and simple, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

NT Script Help for itrend.

Old October 17th, 2011, 12:35 PM   #1 (permalink)
Elite Member
Futures Experience: Beginner
Platform: NT
Favorite Futures: NQ
sudhirc's Avatar
Posts: 265 since Sep 2011
Thanks: 1,258 given, 285 received

NT Script Help for itrend.

Scipt: ITrend (I think i got this from Ninja forums)

Trying to change the color of the trigger to change to lime when it crosses above the itrend and red when it crosses below itrend.

Smooth = (Price + 2*Price[1] + 2*Price[2] + Price[3])/6;
Itrend = (1 - .5*alpha)*(1 - .5*alpha)*(Smooth-2*Smooth[1] + Smooth[2]) + 2*(1 - alpha)*Itrend[1] - (1 - alpha)*(1 - alpha)*Itrend[2];
If currentbar < 7
then Itrend = (Price - 2*Price[1]+ Price[2]) / 4;
Plot1(Itrend, "Itrend");
Plot2(Itrend[1], "Trigger");

Thanks for your help in advance.

Reply With Quote

Old October 17th, 2011, 12:43 PM   #2 (permalink)
Site Administrator
Manta, Ecuador
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
Big Mike's Avatar
Posts: 45,447 since Jun 2009
Thanks: 28,847 given, 79,601 received

Thread Moved

Moved to NinjaTrader Programming

When creating a new thread, note which subforum you are in. Here is a short list of suggestions:

- Topic: Anything to do with an Elite indicator -> Subforum: The Elite Circle
- Topic: Looking for an existing indicator, or how-to use an indicator -> Subforum: (the platform)
- Topic: Programmer needing help with non-Elite indicator -> Subforum: (the platform) - Programming
- Topic: Want an indicator created/modified -> Reply to "Want indicator created free" in Elite Circle
- Topic: Vendors (trading rooms, commercial indicators) -> Subforum: Vendors/Product Reviews
- Topic: Discussion of Forex or Currency trading -> Subforum: Forex and Currency Trading
- Topic: Journals of your trading -> Subforum: Trading Journals or Elite Trading Journals
- Topic: General trading related discussions -> Subforum: Traders Hideout
- Topic: Discussion of a trading method -> Subforum: Traders Hideout
- Topic: Automated Trading -> Subforum: Elite Automated Trading

Last, any Elite Member may create more or less any of these topics in The Elite Circle at your own discretion (your support is appreciated).

This is just a short general list and doesn't cover everything. If you are unsure where to create your new thread, just create it in Traders Hideout and a moderator will move it if necessary.

-- Big Mike Trading

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote

Old October 17th, 2011, 12:47 PM   #3 (permalink)
Administrator: Retired Backtester
 Vendor: speedytradingservers.com 
Rennes France
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
sam028's Avatar
Posts: 3,188 since Jun 2009
Thanks: 3,430 given, 3,728 received

Is it for Ninjatrader or for another platform ?
It looks like EL, not C#...

Usually in trading, those who know don't talk, and those who talk don't know. (Al Brooks)
success requires no deodorant! (Sun Tzu)
Reply With Quote

Old October 17th, 2011, 12:54 PM   #4 (permalink)
Elite Member
Futures Experience: Beginner
Platform: NT
Favorite Futures: NQ
sudhirc's Avatar
Posts: 265 since Sep 2011
Thanks: 1,258 given, 285 received

It for NT7 may be i copied the wrong lines from the script.

/// This method is used to configure the indicator and is called once before any bar data is loaded.
protectedoverridevoid Initialize()

new Plot(Color.FromKnownColor(KnownColor.Blue), PlotStyle.Line, "TrendPlot"));
new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Line, "TriggerPlot"));

trend =
new DataSeries(this);
trigger =
new DataSeries(this);
smooth =
new DataSeries(this);

CalculateOnBarClose =
Overlay =
PriceTypeSupported =

/// Called on each bar update event (incoming tick)
protectedoverridevoid OnBarUpdate()

if (CurrentBar==0)


int Per1=PeriodsP;
int Per2=PeriodsP;

if(CurrentBar <= 7)

double SmoothTemp = (Median[0] + 2* Median[1] + 2* Median[2] + Median[3])/6;

double ItrendTemp = (alpha - alpha*alpha/4)* smooth[0]+0.5*alpha*alpha*smooth[1]-(alpha-0.75*alpha*alpha)*smooth[2]+2*(1-alpha)*trend[1]-(1-alpha)*(1-alpha)*trend[2];
//double ItrendTemp = (1 - .5 * alpha)* (1 - .5*alpha)*(smooth[0] - 2*smooth[1] + smooth[2]) + 2*(1 - alpha)* trend[1] - (1 - alpha)*(1 - alpha)*trend[2];



Thank you,

Reply With Quote


futures.io > Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader > NinjaTrader Programming > NT Script Help for itrend.

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

Similar Threads
Thread Thread Starter Forum Replies Last Post
Script to download nt replay data vegasfoster NinjaTrader Programming 5 October 2nd, 2012 01:24 AM
Need little help with a Ninjatrader script raindrop NinjaTrader Programming 9 April 20th, 2011 10:35 PM
NT indicator script compiling issuses / error while importing skyfly NinjaTrader Programming 8 July 20th, 2010 12:56 AM
How do you clear a NT script error from bad indi, cannot compile until addressed. dreambig The Elite Circle 6 July 6th, 2010 08:59 AM
Looking for this script or indicator. rh017548 NinjaTrader Programming 3 May 16th, 2010 07:00 PM

All times are GMT -4. The time now is 01:05 AM.

Copyright © 2016 by futures.io. 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.
no new posts

Page generated 2016-10-27 in 0.25 seconds with 19 queries on phoenix via your IP