NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 08-04-2012, 01:39 PM   #1
skipper
Junior Member
 
Join Date: May 2012
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
Default color SMA based on slope???

I am interested in an indicator that colors SMA lines based on slope, up and down. Sierra charts has this option for the SMA indicator but i have not found similar for Ninja. Does anyone know where i can find this indicator? Closest i have seen for ninja is the HMAColourChange which would work if it was adaptable to the SMA (adaptable for other MAs would be even better, but SMA will be a great help.)
I've searched this forum but links are broken, lead nowhere or cycle back to the same links that go....nowhere (including bigmike).
Indicator seems simple enough, but i am not a programmer. Any help would be much appreciated as i would like to drop sierra charts and use ninja exclusively. Thanks.

skipper
skipper is offline  
Reply With Quote
Old 08-04-2012, 04:13 PM   #2
sledge
Senior Member
 
Join Date: Aug 2010
Location: Washington, D.C.
Posts: 1,184
Thanks: 178
Thanked 301 times in 259 posts
Default

There is an EMA colored slope indicator in the Indicator forums.

http://www.ninjatrader.com/support/f...d=4&linkid=418

Import this into your Ninjatrader. Files->Utilities->Import Ninjascript.

Edit the EMA Colored Slope indicator in your indicator list.

Also edit the the EMA indicator in NT, you'll see a matching line. This calculates the EMA.

Code:
Value.Set(CurrentBar == 0 ? Input[0] : Input[0] * (2.0 / (1 + Period)) + (1 - (2.0 / (1 + Period))) * Value[1]);
This is the easy part.

Highlight and ERASE this line in the EMA Colored Slope Indicator.

Edit the SMA indicator in NT.

You'll see these lines.

Code:
            if (CurrentBar == 0)
                Value.Set(Input[0]);
            else
            {
                double last = Value[1] * Math.Min(CurrentBar, Period);

                if (CurrentBar >= Period)
                    Value.Set((last + Input[0] - Input[Period]) / Math.Min(CurrentBar, Period));
                else
                    Value.Set((last + Input[0]) / (Math.Min(CurrentBar, Period) + 1));
            }
Copy these out, and put them in the EMA Colored Slop Indicator.

Right Click in the editor and "Save As" "SMA_Colored_Slope" or whatever you want to call it.

Hit F5 to compile.

It should be available now, and should work if all was successful. Sorry, I didn't test it.




Quote:
Originally Posted by skipper View Post
I am interested in an indicator that colors SMA lines based on slope, up and down. Sierra charts has this option for the SMA indicator but i have not found similar for Ninja. Does anyone know where i can find this indicator? Closest i have seen for ninja is the HMAColourChange which would work if it was adaptable to the SMA (adaptable for other MAs would be even better, but SMA will be a great help.)
I've searched this forum but links are broken, lead nowhere or cycle back to the same links that go....nowhere (including bigmike).
Indicator seems simple enough, but i am not a programmer. Any help would be much appreciated as i would like to drop sierra charts and use ninja exclusively. Thanks.

skipper
Last edited by sledge; 08-04-2012 at 04:15 PM. Reason: import
sledge is offline  
Reply With Quote
The following user says thank you to sledge for this post:
Old 08-04-2012, 04:16 PM   #3
NinjaTrader_AdamP
NinjaTrader Customer Service
 
NinjaTrader_AdamP's Avatar
 
Join Date: Aug 2011
Location: Denver, CO, USA
Posts: 2,895
Thanks: 241
Thanked 375 times in 365 posts
Default

Skipper,

There are many indicators available out there that do something like this.

The links should work just fine here in our forum file sharing sections so if they are not working right there may be something wrong with your web browser or internet security software.

Big Mikes generally requires a life time membership to download indicators which is something like 50 dollars one time payment. We also have a lot of 3rd party add on providers.

Indicator forum : http://www.ninjatrader.com/support/f...ks.php?catid=4

Third party add ons : http://www.ninjatrader.com/partners#Third-Party-Add-Ons

If you need something specific that doesn't exist you could always discuss your requirements with a NinjaScript consultant.

http://www.ninjatrader.com/partners#...pt-Consultants
NinjaTrader_AdamP is offline  
Reply With Quote
Old 08-06-2012, 02:01 PM   #4
skipper
Junior Member
 
Join Date: May 2012
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
Default

thanks adam, found what i need
skipper
skipper is offline  
Reply With Quote
Old 08-06-2012, 02:02 PM   #5
skipper
Junior Member
 
Join Date: May 2012
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
Default

thanks sledge, found what i need
i appreciate your time

skipper
skipper is offline  
Reply With Quote
Reply

Tags
color change, slope, sma

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
change candle color based on sma sntrade Charting 1 08-23-2011 04:36 PM
SMA with color based on slope achiever Miscellaneous Support 2 10-07-2009 07:46 AM
Slope of Tangent along SMA dadof3and3 NinjaScript File Sharing Discussion 1 01-28-2009 05:55 PM
Make an HMA or SMA change color based on slope? pclark Charting 1 10-01-2008 03:21 AM
Color Based on Slope joecgoodman Indicator Development 4 06-15-2008 11:20 PM


All times are GMT -6. The time now is 03:50 PM.