Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Close Price Indicator - SMA

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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

    #2
    Hello,

    The default SMA will give you the value based off the Close price. Does this indicator not offer what you are looking for?
    MatthewNinjaTrader Product Management

    Comment


      #3
      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

      Comment


        #4
        Thanks for the clarification.

        Believe the attached will do what you're looking for.
        Attached Files
        MatthewNinjaTrader Product Management

        Comment


          #5
          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

          Comment


            #6
            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?
            MatthewNinjaTrader Product Management

            Comment


              #7
              Hi Matt,

              You got it. It was the Plot0 on the Close indicator.

              A final question I hope. Am I calculating different things?

              Doing the math I see that for AAPL, the Last Price Column (585.16) minus the 10 period SMA (597.88) should equal -12.72. Shouldn't this be the same thing that the ClosePriceSMA(10) custom indicator is calculating? Instead the ClosePriceSMA(10) column is showing -12.43. What am I missing?

              I have attached a word doc with screen shots of my column and indicator setups.

              Thank you as always. You've been terrific.
              Attached Files

              Comment


                #8
                Hello,

                You're doing the math right and those are for sure not the correct values. This indicator simply takes the Close of the current bar and subtracts the Sma period.

                I'm curious about the last price column you have - can you please clarify who you use as your data provider?

                If you add in another column using a 1 period SMA with calculate on bar close = false, does the 1 Period SMA match the LastPrice column?
                MatthewNinjaTrader Product Management

                Comment


                  #9
                  Hi Matt,


                  My data provider currently is setup as Yahoo!.

                  I added the SMA(1) colum you suggested and it matched the value of my Last Price column. Ironically, the SMA(10) value - Last Price value = the ClosePrice indicator value, as it should have. I did have to recreate the Market Analyzer layout as I didn't save it previously.

                  Bottom line, it looks as if it is working, any idea what I was doing incorrectly? Do you think that the last price or SMA(10) was setup incorrectly?

                  Thanks again for your help. I've attaced a screenshot of the Market Analyzer.

                  Art
                  Attached Files

                  Comment


                    #10
                    Art,

                    I'm not totally sure why that wasn't work for you earlier, but I'm glad to see they are working now.

                    I'd suggest keeping an eye on the 1 period SMA to see if you ever run into a case where that does not match your last price.

                    You can always right click on the market analyzer and select reload historical data to update the values.
                    MatthewNinjaTrader Product Management

                    Comment


                      #11
                      Matt,

                      Thank you sir. You've been great. Very helpful and timely in your responses.

                      Best,

                      Art

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by cre8able, Today, 01:16 PM
                      1 response
                      3 views
                      0 likes
                      Last Post NinjaTrader_Gaby  
                      Started by chbruno, 04-24-2024, 04:10 PM
                      3 responses
                      47 views
                      0 likes
                      Last Post NinjaTrader_Gaby  
                      Started by samish18, Today, 01:01 PM
                      1 response
                      6 views
                      0 likes
                      Last Post NinjaTrader_LuisH  
                      Started by WHICKED, Today, 12:56 PM
                      1 response
                      8 views
                      0 likes
                      Last Post NinjaTrader_Gaby  
                      Started by WHICKED, Today, 12:45 PM
                      1 response
                      11 views
                      0 likes
                      Last Post NinjaTrader_Gaby  
                      Working...
                      X