![]() |
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
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: May 2012
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
|
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 |
|
|
|
|
|
#2 | |
|
Senior Member
Join Date: Aug 2010
Location: Washington, D.C.
Posts: 1,184
Thanks: 178
Thanked 301 times in 259 posts
|
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]); 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));
}
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:
Last edited by sledge; 08-04-2012 at 04:15 PM.
Reason: import
|
|
|
|
|
|
The following user says thank you to sledge for this post: |
|
|
|
#3 |
|
NinjaTrader Customer Service
Join Date: Aug 2011
Location: Denver, CO, USA
Posts: 2,895
Thanks: 241
Thanked 375 times in 365 posts
|
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
Adam P.
NinjaTrader Customer Service |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: May 2012
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
|
thanks adam, found what i need
skipper |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: May 2012
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
|
thanks sledge, found what i need
i appreciate your time skipper |
|
|
|
![]() |
| Tags |
| color change, slope, sma |
| Thread Tools | |
| Display Modes | |
|
|
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 |