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 07-29-2012, 06:17 PM   #1
Hockey_Mike
Junior Member
 
Join Date: Jul 2012
Posts: 11
Thanks: 0
Thanked 0 times in 0 posts
Default Close Price Indicator - SMA

Hi All,


Does anyone have a Last Close Price - SMA indicator they would recomend. I am new to NT.

Thank you in advance for any suggestions or thoughts.


Regards,

Art
Hockey_Mike is offline  
Reply With Quote
Old 07-29-2012, 06:22 PM   #2
NinjaTrader_Matthew
NinjaTrader Customer Service
 
NinjaTrader_Matthew's Avatar
 
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,792
Thanks: 160
Thanked 568 times in 559 posts
Default

Hello,

The default SMA will give you the value based off the Close price. Does this indicator not offer what you are looking for?
NinjaTrader_Matthew is online now  
Reply With Quote
Old 07-29-2012, 06:39 PM   #3
Hockey_Mike
Junior Member
 
Join Date: Jul 2012
Posts: 11
Thanks: 0
Thanked 0 times in 0 posts
Default

Hi Matt,

I am looking for the difference between the Close and SMA.

ie.

Close = 100
SMA = 95
I am looking for the value +5

Similarly

Close = 85
SMA = 95
I would be looking for the value -10

As far as I can tell there isn't a parameter in the built-in SMA to do this calculation.

Thanks
Hockey_Mike is offline  
Reply With Quote
Old 07-29-2012, 06:48 PM   #4
NinjaTrader_Matthew
NinjaTrader Customer Service
 
NinjaTrader_Matthew's Avatar
 
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,792
Thanks: 160
Thanked 568 times in 559 posts
Default

Thanks for the clarification.

Believe the attached will do what you're looking for.
Attached Images
File Type: png closemsma.PNG (87.3 KB, 11 views)
Attached Files
File Type: zip ClosePriceSMA.zip (3.6 KB, 8 views)
NinjaTrader_Matthew is online now  
Reply With Quote
Old 07-29-2012, 11:04 PM   #5
Hockey_Mike
Junior Member
 
Join Date: Jul 2012
Posts: 11
Thanks: 0
Thanked 0 times in 0 posts
Default

Hi Matt,

This was exactly what I was looking for. Thank you.

I tried to load this as a column in the Market Analyzer, however the analyzer is leaving that row blank for all stocks I tried.

Is there another setting or flag I need to check/select? Is there something about this custom indicator that won't let me use it in the Market Analyzer?


Thanks
Hockey_Mike is offline  
Reply With Quote
Old 07-29-2012, 11:09 PM   #6
NinjaTrader_Matthew
NinjaTrader Customer Service
 
NinjaTrader_Matthew's Avatar
 
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,792
Thanks: 160
Thanked 568 times in 559 posts
Default

Hello,

This should work int he market analyzer. Are you sure you have the Plot set to Plot0?

What data series do you have the indicator applied to? Is it a minute, tick or daily interval? Who is your data provider?
NinjaTrader_Matthew is online now  
Reply With Quote
Reply

Tags
indicator, 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
SMA Greater than Close Hockey_Mike Market Analyzer 5 07-27-2012 10:36 AM
Discrepancy between plotted SMA and Indicator SMA? Bogomir28 Indicator Development 2 03-24-2012 03:49 PM
indicator to plot the 50 period sma of the 5 sma brdnickel NinjaScript File Sharing Discussion 6 01-26-2011 01:03 PM
Close price not ZivalueCharts close price plot in the market analyzer randomwalker Market Analyzer 1 05-22-2010 06:39 PM
Comparing Close to SMA value failing - why? Iggy22 General Programming 2 04-19-2008 12:47 AM


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