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

Moving Avg calculation question.

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

    Moving Avg calculation question.

    Some of my indicators have an internal private DataSeries.
    For example: myValue = new DataSeries(this);
    There may be some bars that don't have a myValue associated with them. What happens if I input the myValue DataSeries into a Moving Average indicator such as EMA
    e.g. EMA(myValue, 23)[0] where the period encompasses some of the bars with no myValue? How does EMA evaluate the previous 23 bars when some of the bars have no myValue associated with some of the bars? Thanks.

    #2
    If you don't stuff in any value, then NT takes the a default which is "Input[0]" which is defaulted to "Close[0]".

    Comment


      #3
      What if my calculated values that I am stuffing in to the myValue DataSeries have no relationship to Input[0] and aren't even the same order of magnitude of Input[0]? What if myValue is, for instance, the number of days since the last full moon except in certain circumstances?

      Comment


        #4
        Then it will take the close of the underlying bar series.
        RayNinjaTrader Customer Service

        Comment


          #5
          Thanks, all. I think I've figured out a way to stuff a good approximation of what I want into my currently "vacant" spots on my DataSeries.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by popecapllc, 08-09-2023, 07:42 PM
          8 responses
          1,341 views
          0 likes
          Last Post Johng22
          by Johng22
           
          Started by ETFVoyageur, 04-30-2024, 02:04 PM
          11 responses
          100 views
          0 likes
          Last Post ETFVoyageur  
          Started by bubblegum, 03-18-2024, 10:41 AM
          3 responses
          44 views
          0 likes
          Last Post vjsworld  
          Started by JamesK1, Today, 02:48 PM
          1 response
          13 views
          0 likes
          Last Post JamesK1
          by JamesK1
           
          Started by llanqui, Today, 03:51 PM
          0 responses
          10 views
          0 likes
          Last Post llanqui
          by llanqui
           
          Working...
          X