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

EMA Slope Indicator NT8

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

    EMA Slope Indicator NT8

    Good Morning all, I am contacting you to ask you support regarding one indicator that I am trying to develop.

    I am writing a strategy and I do need an indicator who print the slope value of the Exponential Moving Average EMA.

    I've tried to create this indicator the inputs are:

    1) The length of the EMA to be used.
    2)The starting point of a series to be evaluated

    I've copied and modified this example from the NT help:

    // Original
    // Prints the slope of the 20 period simple moving average of the last 10 bars
    *
    Print(Slope(SMA(20), 10, 0));

    // Mine
    // Prints the slope of the EMALenght period Exponential moving average of the //SeriesStartingPoint bars


    Print(Slope(EMA(EMALenght), SeriesStartingPoint, 0));


    The Script is compiling but when I load it on the chart the indicator box it is Empty.
    Could you please have a look to it if I've made any mistake when I created the indicator.

    Here attached a copy of the indicator that I made.

    Thank you in advance for your support.

    Marco
    Attached Files

    #2
    Hello demo152160,

    Please read about current bar checks at the following link.



    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Good Evening Alan and thank you for your reply.
      I've done the modification requested here to follow the code of the indicator:

      protected override void OnBarUpdate()
      {
      /// Prints the slope of the SeriesStartingPoint period Exoponential moving average of
      ///the last EMALenght bars
      *
      if (CurrentBar < 1)
      return;


      Print(Slope(EMA(EMALenght), SeriesStartingPoint, 0));

      }

      But is still not printing any line in the indicator's box, the chart set is 500 Bars which should be enough, this indicator it should be pretty easy to do maybe I've done some stupid mistake when I've created it.
      Have you got any other advice for me?

      Thank you
      Marco

      Comment


        #4
        Hello Marco,

        Please upload the code in the format below and I will test on my end.

        To export a NinjaScript from NinjaTrader 8 do the following:
        From the Control Center window select Tools -> Export -> NinjaScript...
        Click Add>Select the indicator>OK>Export.
        Then attach that file you saved; under My Docs>NT8>Bin>Custom>Select the downloaded .zip file.

        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          Hi Alan,

          Is there a finished indicator for this available somewhere? I'd like to see it as an oscillator.

          Thanks in advance!

          Comment


            #6
            Hello PN720,

            I'm unaware of an existing finished version of this indicator, but perhaps someone on the forum can provide you with a copy.

            Please let us know if you need further assistance.
            Alan P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by RubenCazorla, Today, 09:07 AM
            2 responses
            11 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by i019945nj, 12-14-2023, 06:41 AM
            7 responses
            81 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by timmbbo, 07-05-2023, 10:21 PM
            4 responses
            158 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by tkaboris, Today, 08:01 AM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by Lumbeezl, 01-11-2022, 06:50 PM
            31 responses
            818 views
            1 like
            Last Post NinjaTrader_Adrian  
            Working...
            X